HeaderItem
A button in a screen's header, drawn by the platform.
Utilisation
Add a navigation header action.
// 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] },
};Déclaration du type
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;
}Membres 4
| Nom | Type | Requis | Description |
|---|---|---|---|
label | string | Oui | What it says; with an icon, what a screen reader reads. |
icon | string | { ios?: string; android?: string;} | Non | A symbol shown instead of the label: an SF Symbol on iOS, a Material Symbol on Android. |
onPress | () => void | Oui | — |
disabled | boolean | Non | — |
onPress — signatures de méthode
Signatures
(): voidParamètres
Aucun paramètre.
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.