Showcases and examples
7 documented examples · Context from Dropdown Menu
Usage
A single menu row that reveals a nested flyout of its own items. The row adopts DropdownMenuItem semantics (label / icon / description / isDisabled); its children become the flyout content. Opens inline-end with viewport auto-flip; Right/Enter/Space opens and focuses the first item, Left/Escape closes and returns focus to the trigger (Right/Left swap in RTL). For data-driven menus, give a menu item a nested items array instead of using this component directly.
Typed props
| Prop | Type and behavior |
|---|
label | ReactNodePrimary label text for the trigger row. |
|---|
icon | IconTypeIcon to display before the label. See astryx docs icons for valid semantic names. |
|---|
description | ReactNodeSecondary description text displayed below the label. |
|---|
children | ReactNode |
|---|
isDisabled | boolean · default falseA disabled submenu renders its trigger row but never opens the flyout. |
|---|
hasSpinner | boolean · default falseShow a spinner in place of the caret, e.g. while a lazy submenu's children are loading. |
|---|
menuWidth | number | stringMinimum flyout width. The flyout may grow for its content, but it is capped to the available viewport space. Defaults to intrinsic sizing (min 160px). |
|---|
onOpenChange | (isOpen: boolean) => voidCalled when the flyout opens or closes. |
|---|
xstyle | StyleXStylesStyleX styles for the trigger row. Must be a stylex.create() value: not an inline style object like style={{}}. |
|---|