Menu with a rail
A picker over many sections: a rail of their marks, the chosen one's rows, one option chip on a row or the head.
import { MenuRail, MenuRailTab, MenuHead and 1 more } from "@arcadia/ui"TSX
Examples
- 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.
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
MenuOptionat 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.