ContextMenuItem
An item of the menu: the value the app keeps, and the label the user reads.
Utilização
Offer actions for an episode
Este tipo é usado por 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>
);
}Declaração do tipo
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;
};Membros 4
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
value | string | Sim | — |
label | string | Sim | — |
destructive | boolean | Não | Drawn as an action that deletes or discards, in red. |
disabled | boolean | Não | Shown dimmed; the user can't pick it. |
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.