ContextMenu API
import { ContextMenu } from '@editora/ui-react';
Props
| Prop | Type | Description |
|---|---|---|
anchorEl | HTMLElement | null | |
anchorId | string | |
anchorPoint | { x: number; y: number } | |
closeOnEscape | boolean | |
closeOnSelect | boolean | |
density | 'default' | 'compact' | 'comfortable' | |
disabled | boolean | |
elevation | 'default' | 'none' | 'low' | 'high' | |
items | MenuItem[] | |
onChange | (open: boolean) => void | |
onClose | () => void | |
onCloseDetail | (detail: { open: boolean; previousOpen: boolean; source: string }) => void | |
onOpen | () => void | |
onOpenDetail | (detail: { open: boolean; previousOpen: boolean; source: string }) => void | |
onSelect | (detail: { index: number; value?: string; label?: string; checked?: boolean; item?: HTMLElement }) => void | |
open | boolean | |
radius | number | string | 'none' | 'sm' | 'md' | 'lg' | 'full' | |
shape | 'default' | 'square' | 'soft' | |
size | 'sm' | 'md' | 'lg' | '1' | '2' | '3' | |
state | 'idle' | 'loading' | 'error' | 'success' | |
stateText | string | |
tone | 'default' | 'brand' | 'neutral' | 'info' | 'danger' | 'success' | 'warning' | |
typeahead | boolean | |
variant | 'default' | 'surface' | 'soft' | 'solid' | 'outline' | 'contrast' | 'flat' |
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Element: <ui-context-menu>
ContextMenu renders the ui-context-menu custom element from @editora/ui-core, which can also be used without React.
Attributes: close-on-escape, close-on-select, density, disabled, elevation, headless, open, placement, radius, shape, size, state, state-text, tone, typeahead, variant
Events: change, select