ContextMenu
The Dropdown, opened where you right-click.
Installation
Install ContextMenu from the Fluid Effect UI registry.
Usage
Right-click to open it at the pointer. Use Share to open a submenu.
Pick what opens it
Only the file rows open the menu. Gaps retain the browser context menu.
Keyboard
Shift + F10 or the Menu key opens it on the focused element. Escape closes it and returns focus.
API Reference
Types come from the public API. A dash indicates no default is documented here.
ContextMenu props
Public source| Prop | Type | Default | Description |
|---|---|---|---|
key | string | undefined | '' | The child's identity among its parent's children of one component. The empty string by default. |
onEmit | Show type((events: ContextMenuEvents) => NoInfer<Msg> | undefined) | { readonly RequestedClose: (event: { readonly _tag: "RequestedClose"; readonly reason: "none" | "trigger-press" | "list-navigation" | "item-press" | "outside-press" | "escape-key" | "focus-out" | "cancel-open" | "trigger-hover" | "trigger-focus" | "sibling-open"; }) => NoInfer<Msg> | undefined; readonly RequestedOpen: (event: { readonly _tag: "RequestedOpen"; readonly reason: "none" | "trigger-press" | "list-navigation" | "item-press" | "outside-press" | "escape-key" | "focus-out" | "cancel-open" | "trigger-hover" | "trigger-focus" | "sibling-open"; readonly triggerId: string | null; }) => NoInfer<Msg> | undefined; readonly Picked: (event: { readonly value: string; readonly _tag: "Picked"; readonly checked?: boolean | undefined; }) => NoInfer<Msg> | undefined; readonly Settled: (event: { readonly _tag: "Settled"; readonly open: boolean; }) => NoInfer<Msg> | undefined; readonly Highlighted: (event: { readonly _tag: "Highlighted"; readonly value: string | null; readonly reason: "none" | "keyboard" | "pointer"; }) => NoInfer<Msg> | undefined; } | undefined | — | Handle the child's events with a callback, or supply one handler per tag for tagged events. Return a parent message to dispatch it, or `undefined` to ignore the event. |
props.open | boolean | Required | |
props.items | Show typereadonly { readonly label: string; readonly value: string; readonly disabled?: boolean | undefined; readonly checked?: boolean | undefined; }[] | Required | |
props.id | string | undefined | — | |
props.disabled | boolean | undefined | — | |
props.anchor | Show typestring | { readonly x: number; readonly y: number; readonly width: number; readonly height: number; } | undefined | — | |
props.side | "bottom" | "left" | "right" | "top" | "inline-start" | "inline-end" | undefined | — | |
props.orientation | "horizontal" | "vertical" | undefined | — | |
props.align | "end" | "start" | "center" | undefined | — | |
props.sideOffset | number | undefined | — | |
props.alignOffset | number | undefined | — | |
props.collisionAvoidance | Show type{ readonly side?: "shift" | "none" | "flip" | undefined; readonly align?: "shift" | "none" | "flip" | undefined; readonly fallbackAxisSide?: "end" | "start" | "none" | undefined; } | undefined | — | |
props.collisionBoundary | Show type"clipping-ancestors" | { readonly id: string; } | { readonly x: number; readonly y: number; readonly width: number; readonly height: number; } | undefined | — | |
props.collisionPadding | Show typenumber | { readonly bottom?: number | undefined; readonly left?: number | undefined; readonly right?: number | undefined; readonly top?: number | undefined; } | undefined | — | |
props.sticky | boolean | undefined | — | |
props.arrowPadding | number | undefined | — | |
props.positionMethod | "fixed" | "absolute" | undefined | — | |
props.disableAnchorTracking | boolean | undefined | — | |
props.topLayer | boolean | undefined | — | |
props.highlightItemOnHover | boolean | undefined | — | |
props.finalFocus | boolean | undefined | — | |
props.holdExit | boolean | undefined | — | |
props.loopFocus | boolean | undefined | — | |
kinds | Readonly<Record<string, "checkbox" | "radio" | "action">> | — | |
closeOnClick | boolean | — | |
leading | (item: MenuProps["items"][number]) => View.Content<Msg, R> | undefined | — | |
size | SizeVariant | 'default' | |
shape | ShapeVariant | 'rounded' | |
surface | number | 1 | |
reducedMotion | "user" | "always" | "never" | 'user' | |
className | string | '' | |
contentClassName | string | — | |
ariaLabel | string | Required | |
trigger | View.Input<Msg, R> | Required | |
renderTrigger | (parts: ContextMenuParts) => View.Input<Msg, R> | — | |
renderRows | RenderMenuRows<ContextMenuParts, Msg, R> | — |