Dropdown Menu
Usage
A3S UI dropdown menus are inline-positioned relative to the .dropdown-menu wrapper. This differs from shadcn/ui's portalled Base UI implementation, but keeps the markup dependency-free and matches A3S UI's current popover/select positioning model.
Include CSS
Import Tailwind and one full A3S UI style bundle.
Or import only the base CSS, Dropdown Menu component CSS, and one style pack.
Using CDN or bundler imports? See the Installation page.
Include JavaScript
Copy or serve the full A3S UI JavaScript bundle.
Or copy or serve the A3S UI runtime and Dropdown Menu script.
Using CDN or bundler imports? See the Installation page.
Add your dropdown menu HTML
HTML structure
<div class="dropdown-menu">Relative wrapper for the trigger and inline menu content.
<button aria-haspopup="menu" aria-expanded="false">- Trigger button. The script toggles
aria-expandedand manages keyboard navigation. <div data-popover aria-hidden="true">Menu content popover. Set
data-side="top|right|bottom|left|inline-start|inline-end"anddata-align="start|center|end"to control placement.<div role="menu">Container for menu items, groups, labels, and separators.
<div role="group" aria-labelledby="{ HEADING_ID }">Optional- Groups related menu items.
<div role="heading" id="{ HEADING_ID }">Optional- Group heading/label.
<div role="menuitem">- Standard action item. Use
aria-disabled="true"for disabled items. <div role="menuitemcheckbox" aria-checked="true">- Checkbox-style item. Add a child with
data-indicatorfor the checked icon. <div role="menuitemradio" aria-checked="true">- Radio-style item. Add a child with
data-indicatorfor the selected icon. <kbd>Optional- Shortcut hint aligned to the inline end of the item.
<hr role="separator">Optional- Separator between groups or options.
JavaScript API
Examples
Basic
Shortcuts
Icons
Checkboxes
Checkboxes Icons
Radio group
Radio Icons
Destructive
Avatar
RTL
Dropdown menus support document direction. Set dir="rtl" on the dropdown root or a parent element. Use logical alignment data attributes where possible.