ContextMenuProps
Props of ContextMenu: the menu's items and title, and the views it opens on.
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 ContextMenuProps = {
/** In the order the menu lists them; each value names one item. */
items: ContextMenuItem[];
/** Heads the menu. */
title?: string;
/** Opens no menu. */
disabled?: boolean;
onSelect?: (event: ContextMenuEvent) => void;
/** The views a long press opens the menu on, laid out inside it as a Box's. */
children?: KuitoNode;
};Mitglieder 5
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
items | ContextMenuItem[] | Ja | In the order the menu lists them; each value names one item. |
title | string | Nein | Heads the menu. |
disabled | boolean | Nein | Opens no menu. |
onSelect | (event: ContextMenuEvent) => void | Nein | — |
children | KuitoNode | Nein | The views a long press opens the menu on, laid out inside it as a Box's. |
onSelect — Methodensignaturen
Signaturen
(event: ContextMenuEvent): voidParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
event | ContextMenuEvent | Ja | — |
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.