ContextMenuItem
An item of the menu: the value the app keeps, and the label the user reads.
Usage
Offer actions for an episode
This type is used by 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>
);
}Type declaration
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;
};Members 4
| Name | Type | Required | Description |
|---|---|---|---|
value | string | Yes | — |
label | string | Yes | — |
destructive | boolean | No | Drawn as an action that deletes or discards, in red. |
disabled | boolean | No | Shown dimmed; the user can't pick it. |
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.