Skip to content

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.

Right-click here

Pick what opens it

Only the file rows open the menu. Gaps retain the browser context menu.

Q3 report.pdf
Roadmap.fig
Notes.md

Keyboard

Shift + F10 or the Menu key opens it on the focused element. Escape closes it and returns focus.

Focus here, then press Shift + F10

API Reference

Types come from the public API. A dash indicates no default is documented here.

ContextMenu props

Public source
PropTypeDefaultDescription
keystring | 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.openbooleanRequired
props.items
Show type
readonly { readonly label: string; readonly value: string; readonly disabled?: boolean | undefined; readonly checked?: boolean | undefined; }[]
Required
props.idstring | undefined—
props.disabledboolean | undefined—
props.anchor
Show type
string | { 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.sideOffsetnumber | undefined—
props.alignOffsetnumber | 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 type
number | { readonly bottom?: number | undefined; readonly left?: number | undefined; readonly right?: number | undefined; readonly top?: number | undefined; } | undefined
—
props.stickyboolean | undefined—
props.arrowPaddingnumber | undefined—
props.positionMethod"fixed" | "absolute" | undefined—
props.disableAnchorTrackingboolean | undefined—
props.topLayerboolean | undefined—
props.highlightItemOnHoverboolean | undefined—
props.finalFocusboolean | undefined—
props.holdExitboolean | undefined—
props.loopFocusboolean | undefined—
kindsReadonly<Record<string, "checkbox" | "radio" | "action">>—
closeOnClickboolean—
leading(item: MenuProps["items"][number]) => View.Content<Msg, R> | undefined—
sizeSizeVariant'default'
shapeShapeVariant'rounded'
surfacenumber1
reducedMotion"user" | "always" | "never"'user'
classNamestring''
contentClassNamestring—
ariaLabelstringRequired
triggerView.Input<Msg, R>Required
renderTrigger(parts: ContextMenuParts) => View.Input<Msg, R>—
renderRowsRenderMenuRows<ContextMenuParts, Msg, R>—