GitHub

Dropdown

A contextual menu with checkbox items, links, placement options, and htmx integration.

<rhx-dropdown>

Examples

Basic Dropdown

Placements

Checkbox Items

Link Items

htmx Integration

Select an action...

States

Properties

Property Type Default Description
rhx-open bool false Whether the dropdown is initially open
rhx-placement string bottom-start Menu position: bottom-start, bottom-end, top-start, top-end
rhx-disabled bool false Disables the dropdown trigger
rhx-stay-open bool false Keep menu open after item selection (useful for checkboxes)
aria-label string - Accessible label for the dropdown menu

Item Properties

Properties for <rhx-dropdown-item> elements.

Properties

Property Type Default Description
rhx-type string normal Item type: normal, checkbox
rhx-checked bool false Checked state for checkbox items
rhx-value string - Value associated with the item
rhx-disabled bool false Disables the item
rhx-href string - Renders the item as a navigation link
aria-label string - Accessible label for the item

Accessibility

  • The trigger button receives aria-haspopup="true" and aria-expanded reflecting menu state.
  • The menu uses role="menu" with items using role="menuitem" or role="menuitemcheckbox".
  • Arrow keys navigate between items; Enter or Space activates the focused item.
  • Escape closes the menu and returns focus to the trigger.
  • Disabled items receive aria-disabled="true" and are skipped during keyboard navigation.
  • Link items render as <a> elements with role="menuitem".