HeaderSearch
The search field a screen's header carries.
Utilização
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 } };Declaração do tipo
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;
}Membros 3
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
placeholder | string | Não | — |
onChange | (text: string) => void | Sim | The text as the user types it. |
onSubmit | (text: string) => void | Não | The user pressed the search key. |
onChange — assinaturas de método
Assinaturas
(text: string): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
text | string | Sim | — |
Devolve
void
onSubmit — assinaturas de método
Assinaturas
(text: string): voidParâmetros
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
text | string | Sim | — |
Devolve
void
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.