Verwendung

Offer actions for an episode

Dieser Typ wird verwendet von ContextMenu

tsx
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

ts
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

NameTypErforderlichBeschreibung
itemsContextMenuItem[]JaIn the order the menu lists them; each value names one item.
titlestringNeinHeads the menu.
disabledbooleanNeinOpens no menu.
onSelect(event: ContextMenuEvent) => voidNein—
childrenKuitoNodeNeinThe views a long press opens the menu on, laid out inside it as a Box's.
onSelect — Methodensignaturen

Signaturen

ts
(event: ContextMenuEvent): void

Parameter

NameTypErforderlichBeschreibung
eventContextMenuEventJa—

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.