Skip to content

refactor(components): menu component upgrade#3011

Draft
julia-wjw wants to merge 1 commit intomasterfrom
component/menu
Draft

refactor(components): menu component upgrade#3011
julia-wjw wants to merge 1 commit intomasterfrom
component/menu

Conversation

@julia-wjw
Copy link
Contributor

Motivations

As part of our epic to improve existing components, this refactor introduces a new composable sub-component API alongside the legacy API, enabling richer item layouts (prefix, suffix, singleSelect, submenu) and better responsive behavior. The legacy API remains fully supported.

Changes

Added

  • New composable API: Menu.Trigger, Menu.Content, Menu.Item, Menu.ItemLabel, Menu.ItemPrefix, Menu.ItemSuffix, Menu.ItemIcon, Menu.GroupLabel, Menu.Separator
  • Menu.Item type prop: "action" (default), "singleSelect", "submenu"
  • Menu.Item variation prop: "destructive"
  • Menu.Item selected prop: controlled boolean for singleSelect items; shows checkmark trailing icon when true
  • Submenu support: type="submenu" accepts a nested Menu.Content child
  • Mobile drill-down: submenu on ≤767px opens a second bottom sheet with back navigation
  • SPEC.md design handoff document
  • Storybook stories: ActionGroup, SingleSelectGroup, SubmenuGroup, MixedGroup

Changed

  • Bottom sheet breakpoint extended to ≤767px (was ~500px)
  • Dim overlay now only shown on ≤489px; hidden on tablet and desktop
  • Layout model changed from CSS subgrid to flexbox per-item
  • Min-width set to 160px; menu width hugs content, no max-width
  • Group label padding: 8px top, 4px bottom
  • Checkmark icon color uses --color-icon token
  • Destructive item hover background (--color-critical--surface) persists on pointer leave
  • Equal border-radius on all corners (--radius-base)
  • No horizontal scrollbar (overflow-x: hidden)

Testing

  • Open Storybook and verify ActionGroup, SingleSelectGroup, SubmenuGroup, MixedGroup stories render correctly
  • Resize to ≤767px: menu should open as a bottom sheet
  • Resize to ≤489px: dim overlay should appear behind the sheet
  • Test keyboard navigation: ↑ ↓ between items, Enter/Space to activate, Escape to close, / to open/close submenus
  • Verify legacy items-based stories (Horizontal, CustomActivator) still work unchanged

In Atlantis we use Github's built in pull request reviews.

Made with Cursor

@julia-wjw julia-wjw requested a review from a team as a code owner March 26, 2026 15:05
@julia-wjw julia-wjw marked this pull request as draft March 26, 2026 15:06
As part of our epic to improve existing components, this refactor
introduces a new composable sub-component API alongside the legacy API,
enabling richer item layouts (prefix, suffix, singleSelect, submenu)
and better responsive behavior. The legacy API remains fully supported.

Added:
- New composable API: Menu.Trigger, Menu.Content, Menu.Item,
  Menu.ItemLabel, Menu.ItemPrefix, Menu.ItemSuffix, Menu.ItemIcon,
  Menu.GroupLabel, Menu.Separator
- Menu.Item type prop: "action" (default), "singleSelect", "submenu"
- Menu.Item variation prop: "destructive"
- Menu.Item selected prop: controlled boolean for singleSelect items
- Submenu support: type="submenu" accepts a nested Menu.Content child
- Mobile drill-down: submenu on ≤767px opens a second bottom sheet
  with back navigation
- SPEC.md design handoff document
- Storybook stories: ActionGroup, SingleSelectGroup, SubmenuGroup, MixedGroup

Changed:
- Bottom sheet breakpoint extended to ≤767px (was ~500px)
- Dim overlay now only shown on ≤489px; hidden on tablet and desktop
- Layout model changed from CSS subgrid to flexbox per-item
- Min-width set to 160px; menu width hugs content, no max-width
- Group label padding: 8px top, 4px bottom
- Checkmark icon color uses --color-icon token
- Destructive item hover background persists on pointer leave
- Equal border-radius on all corners (--radius-base)
- No horizontal scrollbar (overflow-x: hidden)

Made-with: Cursor
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 26, 2026

Deploying atlantis with  Cloudflare Pages  Cloudflare Pages

Latest commit: 739b617
Status: ✅  Deploy successful!
Preview URL: https://49636c0e.atlantis.pages.dev
Branch Preview URL: https://component-menu.atlantis.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant