Components

ContextMenu

A right-click menu on the popover surface.

Available since@crisp-ui-kit/crisp@0.11.0

The right-click menu on the measured popover surface, positioned at the cursor (flipping at the viewport edges).

Right-click anywhere in this box

Installation

npm install @crisp-ui-kit/crisp

Props

Prop

Type

Wrap a target and pass an items array; closes on select, outside pointer-down, and Escape.

Keyboard

The menu carries role="menu", which puts a screen reader into application mode — arrow keys become the only navigation there is — so the full model is implemented rather than implied.

KeyAction
↓ / ↑Move between items, wrapping at both ends. Separators and disabled items are skipped.
Home / EndJump to the first or last item.
Enter / SpaceRun the focused item.
lettersTypeahead — jump to the item starting with what you type; the run resets after 500ms.
EscClose.
TabClose — a menu is not a focus trap.

Opening moves focus to the first enabled item. Escape and selecting an item put focus back on whatever had it before the menu opened; Tab deliberately does not — the browser is already moving focus to the next element, and restoring first would land you in the wrong place.

This is crisp's shared menu model (useMenuKeyboard), the same one Menu and the records table's own popovers run, so every role="menu" surface in the kit behaves alike.

An item with a submenu (an array of the same option shape, nestable) becomes a cascading row with a trailing chevron: { label: "Move to", submenu: [{ label: "Backlog", onSelect }, …] }. It is rendered by Menu's own placement="submenu", so it opens on hover (after a short intent delay) and on ArrowRight / Enter / Space; ArrowLeft and Escape close only that level and return focus to the row; selecting a leaf closes the whole menu. Shortcut, role and checked work on the nested items too. Submenu surfaces use Menu's look, including under variant="dark".

On this page