Skip to content

feat: add dropdown menu - #272

Merged
starc007 merged 3 commits into
mainfrom
feat/dropdown-menu
Nov 16, 2026
Merged

starc007 merged 3 commits into
mainfrom
feat/dropdown-menu

Conversation

@starc007

Copy link
Copy Markdown
Owner

What

New Dropdown Menu component (components/motion/dropdown-menu.tsx) with a preview, registry entry, SEO, dates, about page, changelog line and an a11y test.

  • Panel grows out of its trigger (scale 0.94, 6px travel, 200ms ease-out) and fades out faster on close. Rows stay still; only the highlight glides between them.
  • Submenus open to the side with a 6px gap from the menu edge, flip left when there is no room, and stack under their row on narrow screens. A diagonal path toward an open submenu does not close it.
  • Checkbox and radio items, labels, separators, shortcuts, destructive tone.
  • Flips above the trigger when needed and scrolls inside itself when neither side has room.
  • Keyboard: Enter/Space/ArrowDown open on the first item, ArrowUp on the last, arrows wrap, Home/End, typeahead, ArrowRight/ArrowLeft for submenus, Escape returns focus to the trigger, Tab closes.
  • Unmounts while closed (AnimatePresence + PresenceGate); reduced motion fades only.

Notes for review

  • Focus moves in only after the first placement, since the panel is visibility: hidden until it is positioned.
  • Reopening during the exit animation refocuses the returning panel.
  • Checked in the browser on desktop and at 375px. Not checked on a real phone or with reduced motion.

Checks

bun run check and bun test tests/dropdown-menu.a11y.test.tsx pass.

@starc007
starc007 merged commit 498eaba into main Nov 16, 2026
1 check passed
@starc007
starc007 deleted the feat/dropdown-menu branch November 16, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant