Surface aesthetic override; defaults to nearest provider.
disabled
boolean
false
When true, both primary button and chevron trigger are disabled.
onPrimary
() => void
—
Fires when the primary (label) button is clicked.
onSelect
(value: string) => void
—
Fires with the selected option's value when a menu item is chosen.
ref points to <div>.
Accessibility
WCAG target: 2.1 AA
menu
button
Follows the WAI-ARIA menu button pattern, as PixelDropdown does. The chevron is a button of its own, named "More options", with aria-haspopup="menu", aria-expanded, and aria-controls wired to the menu while it is open. The menu (role="menu", named by the chevron through aria-labelledby) takes focus as it opens (tabindex="-1") and points aria-activedescendant at the highlighted option, so assistive technology follows the arrows, Home/End and typeahead; its role="menuitem" options are not tab stops. Escape, Tab and choosing an option return focus to the chevron; a press outside closes the menu and leaves focus where the pointer put it. The frame clips both halves, so each shows keyboard focus inside its own edge.
Keyboard
Key
Action
When
Enter / Space
Run the primary action (onPrimary).
primary button focused
Enter / Space
Open the menu and move focus into it; close it when it is open.
chevron focused
ArrowDown
Open the menu with focus in it, highlighting the first option.
chevron focused
ArrowUp
Open the menu with focus in it, highlighting the last option.
chevron focused
ArrowDown
Highlight the next option; stops at the last.
menu open
ArrowUp
Highlight the previous option; stops at the first.
menu open
Home
Highlight the first option.
menu open
End
Highlight the last option.
menu open
Enter / Space
Choose the highlighted option (onSelect), close the menu and return focus to the chevron.
menu open
Escape
Close the menu and return focus to the chevron.
menu open
Tab
Close the menu and move focus on from the chevron.
menu open
Shift+Tab
Close the menu and move focus back from the chevron to the primary button.
menu open
a-z / 0-9
Typeahead — highlight the first option whose label starts with the typed prefix.