Utilização

Add a navigation header action.

tsx
// Add a navigation header action.
import { signal, type HeaderItem, type RouteOptions } from 'kuito';

const editing = signal(false);

const edit: HeaderItem = {
  label: 'Edit',
  onPress: () => (editing.value = !editing.value),
};
const add: HeaderItem = {
  label: 'Add',
  icon: { ios: 'plus', android: 'add' },
  onPress: () => console.log('add'),
};

export const options: RouteOptions = {
  title: 'Playlists',
  header: { leading: [edit], trailing: [add] },
};

Declaração do tipo

ts
export interface HeaderItem {
  /** What it says; with an icon, what a screen reader reads. */
  label: string;
  /** A symbol shown instead of the label: an SF Symbol on iOS, a Material Symbol on Android. */
  icon?: string | { ios?: string; android?: string };
  onPress: () => void;
  disabled?: boolean;
}

Membros 4

NomeTipoObrigatórioDescrição
labelstringSimWhat it says; with an icon, what a screen reader reads.
iconstring | { ios?: string; android?: string;}NãoA symbol shown instead of the label: an SF Symbol on iOS, a Material Symbol on Android.
onPress() => voidSim—
disabledbooleanNão—
onPress — assinaturas de método

Assinaturas

ts
(): void

Parâmetros

Sem parâmetros.

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.