Skip to content

feat: [menu, context-menu] add checkbox, radio, and link items - #953

Open
ravisuhag wants to merge 7 commits into
mainfrom
feat/menu-checkbox-radio-link-items
Open

ravisuhag wants to merge 7 commits into
mainfrom
feat/menu-checkbox-radio-link-items

Conversation

@ravisuhag

Copy link
Copy Markdown
Member

Summary

  • Add CheckboxItem, RadioGroup, RadioItem, and LinkItem to Menu and ContextMenu. Checkbox and radio items draw a check mark or dot before the leading icon. LinkItem renders an <a href> and takes a router link through render. All four filter and keep aria-checked in the searchable (autocomplete) mode.

  • Rebuild Menu.EmptyState and ContextMenu.EmptyState on Base UI Autocomplete.Empty in the searchable mode (a polite live region elsewhere). Add Menu.Status and ContextMenu.Status, a hidden live region that announces the match count. Items register into a small count context, because our menus filter their own children and do not pass items to Base UI.

  • Add data-slots for every new part, with tests and Slots tables. Update props, demos, and docs for both components.

  • Why it's like this: the old Ariakit menu had a type="select" cell that drew a checkbox picture with no checked state. The Base UI migration (feat: migrate DropdownMenu to BaseUI #652) removed it and did not add CheckboxItem or RadioItem, likely because they do not plug into the Autocomplete-based searchable menu easily. LinkItem was added to Base UI two weeks before that migration. Menu.EmptyState dates from Nov 2024 and was kept as a plain div.

  • Breaking: small. Menu.EmptyState and ContextMenu.EmptyState now show and hide on their own. They show their children only when the menu renders no items.

  • I have followed the pull request section of the contributing guide.

@vercel

vercel Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
apsara Ready Ready Preview Oct 26, 2026 7:34pm UTC

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 39 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cef81d8f-d56e-4c4a-882a-752d1202d12d
Commits

Reviewing files that changed from the base of the PR and between 91e76a7 and 1c8e7f7.

Files selected for processing: 25
  • apps/www/src/content/docs/components/context-menu/demo.ts
  • apps/www/src/content/docs/components/context-menu/index.mdx
  • apps/www/src/content/docs/components/context-menu/props.ts
  • apps/www/src/content/docs/components/menu/demo.ts
  • apps/www/src/content/docs/components/menu/index.mdx
  • apps/www/src/content/docs/components/menu/props.ts
  • packages/react/components/context-menu/__tests__/context-menu.test.tsx
  • packages/react/components/context-menu/__tests__/data-slots.test.tsx
  • packages/react/components/context-menu/context-menu-item.tsx
  • packages/react/components/context-menu/context-menu-misc.tsx
  • packages/react/components/context-menu/context-menu.tsx
  • packages/react/components/context-menu/index.ts
  • packages/react/components/menu/__tests__/data-slots.test.tsx
  • packages/react/components/menu/__tests__/menu.test.tsx
  • packages/react/components/menu/cell.module.css
  • packages/react/components/menu/cell.tsx
  • packages/react/components/menu/index.ts
  • packages/react/components/menu/menu-checkbox-item.tsx
  • packages/react/components/menu/menu-item.tsx
  • packages/react/components/menu/menu-link-item.tsx
  • packages/react/components/menu/menu-misc.tsx
  • packages/react/components/menu/menu-radio.tsx
  • packages/react/components/menu/menu.module.css
  • packages/react/components/menu/menu.tsx
  • packages/react/index.tsx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/@raystack/apsara@953

commit: 1c8e7f7

Menu.EmptyState and ContextMenu.EmptyState go back to a plain element that the app shows and hides. Menu.Status, ContextMenu.Status, and the shared item count are removed, with their docs, demos, and tests.
A filtered-out checkbox item unmounted the Base UI item, and a group switched to a fragment while filtering, which remounted its items. Both reset uncontrolled checked and radio values. The checkbox item now holds its checked state, and groups stay rendered while filtering. The empty-list styles ignore groups that have no matches.
In a searchable menu, Menu.EmptyState and ContextMenu.EmptyState render Base UI Autocomplete.Empty, a polite live region. The app still decides what it shows. An empty state with no children has no padding, so it can stay mounted.
Export the props types of CheckboxItem, RadioGroup, RadioItem, and LinkItem for Menu and ContextMenu.
Remove an unused handler argument and an unused test import.
…dio-link-items

Resolve conflicts in the menu and context-menu index files, packages/react/index.tsx, and menu-misc.tsx. Keep both export lists, and keep the MenuEmptyStateProps signature from main with the Autocomplete.Empty body.

This branch was successfully deployed

1 active deployment
Preview — 1c8e7f7b Deployed Oct 26, 2026 by vercel[bot]
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.

2 participants