HeaderSearch
The search field a screen's header carries.
Utilisation
Connect header search to a query.
// Connect header search to a query.
import { signal, type HeaderSearch, type RouteOptions } from 'kuito';
const query = signal('');
const search: HeaderSearch = {
placeholder: 'Search shows',
onChange: (text) => (query.value = text),
onSubmit: (text) => console.log('search for', text),
};
export const options: RouteOptions = { title: 'Shows', header: { largeTitle: true, search } };Déclaration du type
export interface HeaderSearch {
placeholder?: string;
/** The text as the user types it. */
onChange: (text: string) => void;
/** The user pressed the search key. */
onSubmit?: (text: string) => void;
}Membres 3
| Nom | Type | Requis | Description |
|---|---|---|---|
placeholder | string | Non | — |
onChange | (text: string) => void | Oui | The text as the user types it. |
onSubmit | (text: string) => void | Non | The user pressed the search key. |
onChange — signatures de méthode
Signatures
(text: string): voidParamètres
| Nom | Type | Requis | Description |
|---|---|---|---|
text | string | Oui | — |
Retourne
void
onSubmit — signatures de méthode
Signatures
(text: string): voidParamètres
| Nom | Type | Requis | Description |
|---|---|---|---|
text | string | Oui | — |
Retourne
void
Généré depuis les déclarations TypeScript publiques : signatures, props et valeurs par défaut viennent de la source vérifiée, les descriptions de sa JSDoc. Aucune valeur par défaut n'est inventée.