ContextMenuItem
An item of the menu: the value the app keeps, and the label the user reads.
Verwendung
Offer actions for an episode
Dieser Typ wird verwendet von ContextMenu
import { ContextMenu, Text, VStack } from 'kuito';
const ITEMS = [
{ value: 'share', label: 'Share' },
{ value: 'played', label: 'Mark played' },
{ value: 'delete', label: 'Delete', destructive: true },
];
export default function Episode() {
return (
<ContextMenu title="Episode 4" items={ITEMS} onSelect={(event) => console.log(event.value)}>
<VStack padding={12}>
<Text>Episode 4</Text>
</VStack>
</ContextMenu>
);
}Typdeklaration
export type ContextMenuItem = {
value: string;
label: string;
/** Drawn as an action that deletes or discards, in red. */
destructive?: boolean;
/** Shown dimmed; the user can't pick it. */
disabled?: boolean;
};Mitglieder 4
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
value | string | Ja | — |
label | string | Ja | — |
destructive | boolean | Nein | Drawn as an action that deletes or discards, in red. |
disabled | boolean | Nein | Shown dimmed; the user can't pick it. |
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.