AhaSlides Design
v0.52.0React · Vue · Lit

Components · Navigation

Dropdown

A trigger button that reveals a floating overlay of actions — with leading icons, dividers, disabled rows and a red danger action.

Examples

Placement
Content
Dropdown · icons · a divider · a disabled row · a red danger action · a submenu → adjacent flyout — click to reveal, hover / ArrowRight to open a submenu

API

PropTypeDefaultNotes
labelstringMenuThe trigger button text
itemsJSON list[]Rows. Leaf {key,label,icon?,disabled?,danger?}; submenu-parent {key,label,icon?,children:[…]} → adjacent flyout; rule {type:'divider'}; section {type:'group',label,children:[]}
placement'bottomLeft' | 'bottomRight' | 'topLeft' | 'topRight'bottomLeftWhere the overlay opens relative to the trigger
trigger'click' | 'hover'clickHow the overlay is revealed
selectCustomEventComposed event on choosing an item, detail { key }

Install

# .npmrc — once: point the @ahaslides-product scope at GitHub Packages
@ahaslides-product:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}   # a GitHub token with read:packages

npm i @ahaslides-product/design
import '@ahaslides-product/design/tokens.css';   // once, at the app root
import '@ahaslides-product/design/aha-dropdown';   // registers <aha-dropdown>

Agent feed for this component (absolute, fetchable anywhere): dropdown.agent.json · dropdown.md · dropdown.llms.txt

When to use

When to use
  • Dropdown — a set of actions or options should sit behind a trigger to save space
  • Menu — the same list belongs inline, always visible — not behind a trigger
  • Select — the control picks a single value for a form field, not fires an action
A dropdown holds actions or navigation, not form values — use Select for a field. Keep the item list short; the panel closes on outside-click and Escape. Give each action a leading icon, rule off a destructive action with a divider and mark it danger. Reach for a submenu-parent (children[]) only when a group of related actions would otherwise crowd the top level — one level of flyout is plenty; deeper nesting is a menu smell. The overlay reuses the shared Menu item vocabulary rather than reinventing the row styling.
Surfaces
editor dashboard admin settings

Spec

Trigger height 40 · radius 8 · white bg, 1px border #E3E3E3, SemiBold 600 · Trigger hover border-hover #D3B4FF (motion-fast + ease-out) · Caret <aha-icon name="system-caret-down" size=16>, rotates 180° when open (motion-mid) · Panel elevated white, radius 8, 6 padding, min-width 200, soft shadow · Placement bottomLeft · bottomRight · topLeft · topRight — anchors the persistent panel · Trigger mode click (default) or hover · Open motion opacity + translateY on a persistent node (motion-mid + ease-out) · Item height 36 · radius 8 · 10px gap to a 16px leading icon · hover bg-hover #F7F7F7 · Danger item color-error #F5222D text, error-tinted hover · Divider 1px split #F1F1F1 rule, role=separator · Group title 11px uppercase, text-tertiary #8A8A8A, non-interactive section header · Disabled item text-disabled #B5B5B5, not-allowed · Submenu parent item with children[]; aria-haspopup=menu, trailing <aha-icon name="system-caret-right" size=14>; brand-tinted (bg-accent #F9F5FF, color-primary #6A1EBB) while its flyout is open · Flyout second elevated panel adjacent to the parent (left:100%), opens on hover / ArrowRight / Enter; fades+scales on a persistent node (motion-mid + ease-out) · Edge-collision flip flyout measures on open; if it overflows the viewport it flips to open on the left (right:100%) · Flyout keyboard Up/Down within the flyout, ArrowLeft / Escape closes it back to the parent (focus returns to the parent row)