AnyLumino
API referenceastryxsurfaces

DropdownMenu

Render a button-backed Astryx dropdown menu.

Astryx Props

JSON-safe DropdownMenu props forwarded to Astryx.

Supported Astryx props include:

  • button (DropdownMenuButtonProps): Props for the trigger button (Button props except onClick).
  • items (DropdownMenuOption[]; required): Array of menu entries. Each entry is one of: an action item '{label, onClick?, icon?, isDisabled?}', a divider '{type: "divider"}', or a section '{type: "section", title?, items: [...action items]}'.
  • isMenuOpen (boolean): Controlled open state for the menu.
  • onOpenChange ((isOpen: boolean) => void): Callback fired when the open state changes.
  • menuWidth (number or string): Custom menu width; defaults to matching the trigger button width.
  • onClick (() => void): Callback fired when the trigger button is clicked.
  • hasChevron (boolean): Whether to show a chevron icon on the trigger button. Set to false for icon-only triggers.
  • children ((item: DropdownMenuItemData) => ReactNode): Custom render function for each item in the list.

Props typed as React nodes, render functions, event handlers, refs, or StyleX styles are documented for Astryx parity but cannot be serialized directly from Python unless the wrapper adapts them.

See Astryx component docs: https://astryx.atmeta.com/components/DropdownMenu.

Functions

constructor__init__(items, *, label, variant='secondary', disabled=False, callbacks=None, action_callbacks=None, open=False, menu_width=None, chevron=None, placement=None, auto_focus=None, **props) -> None
paramitemsIterable[Any]

Item records used by generated child components or static search sources.

paramlabelstr

Visible or accessible label for the component.

paramvariantstr
= 'secondary'

Astryx visual variant.

paramdisabledbool
= False

Whether the component should render disabled.

paramcallbacksIterable[Callable[[ComponentWidget], None]] | None
= None

Python callbacks invoked for frontend activations.

paramaction_callbacksIterable[Callable[[ComponentWidget, Any], None]] | None
= None

Python callbacks receiving the selected menu value.

paramopenbool
= False

Controlled menu visibility.

parammenu_widthint | float | str | None
= None

Menu width; defaults to the trigger width.

paramchevronbool | None
= None

Whether the trigger shows a chevron.

paramplacementstr | None
= None

Menu placement relative to the trigger.

paramauto_focusbool | None
= None

Whether the first menu item receives focus on open.

parampropsAny
= {}

Returns

None

On this page