Utilização

Connect header search to a query.

tsx
// 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

ts
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

NomeTipoObrigatórioDescrição
placeholderstringNão—
onChange(text: string) => voidSimThe text as the user types it.
onSubmit(text: string) => voidNãoThe user pressed the search key.
onChange — assinaturas de método

Assinaturas

ts
(text: string): void

Parâmetros

NomeTipoObrigatórioDescrição
textstringSim—

Devolve

void

onSubmit — assinaturas de método

Assinaturas

ts
(text: string): void

Parâmetros

NomeTipoObrigatórioDescrição
textstringSim—

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.