Skip to content

Menu

In review
Live · web

Click a trigger to drop its menu, anchored and clamped to the stage

Open with a click or Enter / Space / . In the menu: move, opens a submenu, / Esc back, Enter runs.

Session · gateway-refactor
Overflow

Last action: none yet · wrap on · sort recent. Pointer + keyboard both work; the island is live.

// Web: React, consuming @dizyx/nockerl-tokens. (Web is the laggard platform. Spec + live demo,
// not yet exported from @dizyx/nockerl-react; promotion is tracked.)
import { NockerlMenu, MenuItem } from '@dizyx/nockerl-react';
export function SessionOverflow() {
const [wrap, setWrap] = useState(true);
return (
<NockerlMenu trigger={<NockerlIconButton icon="kebab" label="Session actions" />} align="end">
<MenuItem icon="rename" shortcut="⌘R" onSelect={rename}>Rename</MenuItem>
<MenuItem icon="settings" onSelect={editModel}>Edit provider / model</MenuItem>
<MenuItem icon="fork" onSelect={fork}>Fork</MenuItem>
<MenuSection label="View" />
<MenuItem icon="wrap" checked={wrap} onSelect={() => setWrap((v) => !v)}>Wrap lines</MenuItem>
<MenuSub icon="export" label="Export as">
<MenuItem onSelect={() => exportAs('md')}>Markdown (.md)</MenuItem>
<MenuItem onSelect={() => exportAs('json')}>JSON (.json)</MenuItem>
</MenuSub>
<MenuSeparator />
<MenuItem icon="trash" tone="danger" onSelect={confirmDelete}>Delete</MenuItem>
</NockerlMenu>
);
}
PropTypeDefaultDescription
trigger *ReactNodeThe control that opens the menu on click / Enter / Space / . Gets aria-haspopup + aria-expanded.
align'start' | 'end''start'Which trigger edge the menu aligns to. The menu flips up + clamps horizontally to stay on-screen.
children *MenuItem | MenuSeparator | MenuSection | MenuSubThe menu contents: item rows, full-width separators, section labels, and nested submenus.
MenuItem.iconstringOptional leading glyph. The icon column is reserved menu-wide so every label aligns.
MenuItem.shortcutstringTrailing keyboard-shortcut hint (e.g. ⌘R), rendered in the mono font, muted.
MenuItem.checkedbooleanRenders the row as menuitemcheckbox (a leading cyan check). Toggling keeps the menu open.
MenuItem.tone'default' | 'danger''default'A danger item uses the error token and is divider-separated as the tail.
MenuItem.onSelect() => voidActivation handler. Action items close the menu; checkable items toggle in place.