Skip to content

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

Merged
rohanchkrabrty merged 8 commits into
mainfrom
feat/menu-checkbox-radio-link-items
Oct 27, 2026
Merged

rohanchkrabrty merged 8 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 27, 2026 7:33pm UTC

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
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: 70cfe196-818c-47d0-9ab0-c6ff64dda2c3
Commits

Reviewing files that changed from the base of the PR and between 91e76a7 and 5bc3a9b.

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

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

Walkthrough

Menu and Context Menu add checkbox, radio-group, radio-item, and link-item components. The items support autocomplete filtering and expose new prop types and component members. The changes also update item rendering, group and empty-state behavior, and menu-cell styling. Tests cover selection, links, filtering, accessibility attributes, and data slots. Documentation adds API references and examples.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant MenuCheckboxItem
  participant CheckboxPrimitive
  participant onCheckedChange
  User->>CheckboxPrimitive: Select checkbox item
  CheckboxPrimitive->>MenuCheckboxItem: Report checked-state change
  MenuCheckboxItem->>onCheckedChange: Notify when callback is provided
  MenuCheckboxItem-->>User: Render checked state
Loading

Priority: Normal

Merge Risk: Minimal · up to 5bc3a

No actionable issue is established from the available evidence; the change is mergeable after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 38.46% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surv… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: adding checkbox, radio, and link items to Menu and ContextMenu.
Description check Passed The description is directly related to the changeset and covers the new items, filtering behavior, accessibility behavior, tests, documentation, and breaking change.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 38.46% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 13 functions across 21 files. (4 skipped: 4 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

Biome (2.5.15)
apps/www/src/content/docs/components/context-menu/demo.ts

Biome could not lint this file: configuration resulted in errors. Check the repository's Biome configuration and plugins.

apps/www/src/content/docs/components/context-menu/props.ts

Biome could not lint this file: configuration resulted in errors. Check the repository's Biome configuration and plugins.

apps/www/src/content/docs/components/menu/demo.ts

Biome could not lint this file: configuration resulted in errors. Check the repository's Biome configuration and plugins.

  • 20 others

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: 5bc3a9b

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.
…chable empty state

The search list is a listbox, which only allows options and groups inside. Autocomplete.Empty sets role status, aria-live and aria-atomic, and axe reports the element as a child the listbox does not allow.
@rohanchkrabrty
rohanchkrabrty merged commit 4515960 into main Oct 27, 2026
8 checks passed
@rohanchkrabrty
rohanchkrabrty deleted the feat/menu-checkbox-radio-link-items branch October 27, 2026 19:49

This branch was successfully deployed

1 active deployment
Preview — 5bc3a9bc Deployed Oct 27, 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