Skip to content

feat: add non-selectable menu label #1698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sjelfull
Copy link
Member

@sjelfull sjelfull commented Apr 10, 2025

This adds a non-selectable menu label component that allow us to add headers and group certain items.

Example:

<MenuButton
  button={<Button text="Open" />}
  id="label-example"
  menu={
    <Menu>
      <Stack space={1}>
        <MenuLabel text="Label 1" />
        <MenuItem text="Item 1" />
        <MenuItem text="Item 2" />
      </Stack>
      <MenuDivider />
      <MenuLabel text="Label 2" />
      <MenuItem text="Item 3" />
    </Menu>
  }
/>

I have tried to make the label feel well integrated with the other elements, but doesn't have the full overview of what considerations I should make, so leave final decision to you @mariuslundgard

CleanShot 2025-04-10 at 11.05.08.mp4 (uploaded via Graphite)

Copy link

vercel bot commented Apr 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
sanity-ui-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 10, 2025 9:21am
sanity-ui-workshop ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 10, 2025 9:21am

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Verified

This commit was signed with the committer’s verified signature.
sjelfull Fred Carlsen
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.

None yet

1 participant