Skip to content
ArcadiaDesign

TSX

For a choice across many sections: MenuContent takes a MenuRail (rail) and a MenuHead (head), and its rows are the chosen section's. The rail holds one MenuRailTab per section, its mark at 16px in a 28px tab, the chosen one on a fill; its name is the tooltip. The head names the section once, a detail after it in the quiet ink. The chosen row is an ink fill in Body bold, no check, and may end in one MenuOption: a chip that opens a menu beside the whole menu, level with its row. A head may end in one too, the same part.

A search reaches every section: give the rail a null value while it narrows, and say each row's section in its description. The rail's foot takes one control at its end. A section in trouble lights its tab's corner.

Examples

Open, with the row's option

Rendered open in place: the rail, the head with its option, the chosen row's chip and the menu it opens beside the whole menu.

Three sections

The popup is a group: the field a combobox, the rail a vertical tablist whose tabs are named by their labels, the rows a menu. A row's chip is drawn, not focused: the row speaks for it, and its keys reach it. A head's chip is a button with aria-haspopup and aria-expanded.

Tab
Move between the field, the rail, the head's option and the rows
↓↑
Move through the rows; past a section's last row into the next one's first
←→
Step the chosen row's option; with no level, → opens it
↓↑
In the rail: choose a section
Enter→
In the rail: go to the rows. On the head's option: open it
Esc
Close the option's menu, then clear the search, then close

MenuRail

valuerequired
string | null
The chosen section; null: none (a search across every section lets go of it).
onValueChangerequired
(value: string) => void
Called with a section's value: a tab pressed, ↑↓ in the rail, or the rows crossing a section's end.
aria-labelrequired
string
The rail's accessible name.
foot
ReactNode
One control at the rail's foot (an IconButton): a Tab stop after the tabs.
children
ReactNode
MenuRailTabs, in order.

valuerequired
string
This section's value.
labelrequired
string
Its name: the tooltip and the accessible name.
iconrequired
IconName | ReactElement
A registry glyph or a mark element, at 16px.
light
booleanDefault false
A red light on the mark's corner: the section can't serve now (its allowance spent).

titlerequired
ReactNode
What the rows are (a section's name), text-2.
detail
ReactNode
One fact said once for every row, text-3; it gives way first.
option
ReactNode
One MenuOption at the line's end: a Tab stop after the rail.

labelrequired
ReactNode
What the chip says: the option's value now ("High", "Auto").
aria-labelrequired
string
The chip's accessible name, and its menu's.
open
boolean
Controlled open state of its menu.
defaultOpen
boolean
onOpenChange
(open: boolean, details: OpenChangeDetails) => void
onStep
(direction: 1 | -1) => void
On a row: ←→ from any row of the menu step the option's level. Without it, → on its row opens the option.
width
number
Its menu's width in pixels.
onKeyDown
(e: KeyboardEvent<HTMLDivElement>) => void
Its menu's keys, before the menu's own.
style
CSSProperties
Its menu's style (a height that scrolls past some rows).
children
ReactNode
Its menu's rows and controls.