HeaderItem
A button in a screen's header, drawn by the platform.
Verwendung
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] },
};Typdeklaration
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;
}Mitglieder 4
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
label | string | Ja | What it says; with an icon, what a screen reader reads. |
icon | string | { ios?: string; android?: string;} | Nein | A symbol shown instead of the label: an SF Symbol on iOS, a Material Symbol on Android. |
onPress | () => void | Ja | — |
disabled | boolean | Nein | — |
onPress — Methodensignaturen
Signaturen
(): voidParameter
Keine Parameter.
Rückgabe
void
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.