Skip to content

feat(ui): add Mosaic Menu component - #9252

Merged
austincalvelage merged 8 commits into
mainfrom
carp/mosaic-menu
Jul 31, 2026
Merged

feat(ui): add Mosaic Menu component#9252
austincalvelage merged 8 commits into
mainfrom
carp/mosaic-menu

Conversation

@alexcarpenter

@alexcarpenter alexcarpenter commented Jul 27, 2026

Copy link
Copy Markdown
Member

Description

Adds a reusable Mosaic Menu to @clerk/ui, styled with StyleX on top of the @clerk/headless menu primitive.

Preview: https://swingset-git-carp-mosaic-menu.clerkstage.dev/components/menu

Menu.Trigger defaults to a square ghost Button (size='sm') holding an ellipsis glyph; pass children for a labelled trigger, or render to supply your own element. Menu.Content composes the portal, positioner, and popup, so items are the only children consumers write.

<Menu.Root>
  <Menu.Trigger />
  <Menu.Content>
    <Menu.Item label='Add workspace' icon={<PlusIcon />} />
    <Menu.Separator />
    <Menu.Item label='Sign out' onClick={signOut} />
  </Menu.Content>
</Menu.Root>

Styling notes

  • Themed with StyleX (not slot recipes). Each styled part carries a stable .cl-<slot> class (menu-trigger, menu-positioner, menu-popup, menu-item, menu-item-icon, menu-item-label, menu-separator); consumers override from a later CSS layer.
  • Enter/exit transition (opacity + scale) runs off the popup's own data-starting-style / data-ending-style, disabled under prefers-reduced-motion: reduce. Item hover is gated behind @media (hover: hover) and the keyboard-active item styles off data-active, so pointer and keyboard highlighting stay in sync.
  • The popup's max-height tracks --cl-available-height from the positioner, so long menus scroll rather than overflow the viewport.
  • plus and log-out glyphs added to the canonical icon registry (alongside the new ellipsis) rather than duplicated inline.

Build

  • tsdown.mosaic.config.mts now marks @clerk/headless external, matching feat(ui): add Mosaic Popover component #9241. Without it, the bundled .d.ts can't follow headless's extensionless re-export chain in dist/primitives/*/index.d.ts and fails with [MISSING_EXPORT]. Only styles.css ships from this build.
  • Only styles.css ships from the isolated mosaic build; the mosaic JS is not publicly importable yet, so the changeset is empty.

Docs

  • Swingset docs added (menu.component.stories.tsx + .mdx, archetype A · compound) and wired into the registry + docModules. Named menu.component.* so it doesn't collide with the existing headless Menu primitive page.

How to test

  • pnpm --filter @clerk/ui test src/mosaic/components/menu (7 tests)
  • pnpm --filter @clerk/ui build:mosaic — verifies the menu atoms land in styles.css
  • pnpm run dev:swingset → Components → Menu

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🌟 New feature

@vercel

vercel Bot commented Jul 27, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview Jul 31, 2026 12:04pm
swingset Ready Ready Preview Jul 31, 2026 12:04pm

Request Review

@changeset-bot

changeset-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e7ee73a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jul 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@9252

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@9252

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@9252

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@9252

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@9252

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@9252

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@9252

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@9252

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@9252

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@9252

@clerk/express

npm i https://pkg.pr.new/@clerk/express@9252

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@9252

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@9252

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@9252

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@9252

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@9252

@clerk/react

npm i https://pkg.pr.new/@clerk/react@9252

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@9252

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@9252

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@9252

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@9252

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@9252

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@9252

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@9252

commit: e7ee73a

@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-07-31T12:05:06.128Z

Summary

Metric Count
Packages analyzed 19
Packages with changes 0
🔴 Breaking changes 0
🟡 Non-breaking changes 0
🟢 Additions 0

No API Changes Detected

All packages have stable APIs with no detected changes.


Report generated by Break Check

Last ran on e7ee73a.

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a styled Mosaic Menu API with trigger, content, item, and separator components built on headless primitives. It includes StyleX styles, new icons, public exports, interaction tests, a Storybook story, MDX documentation, registry and documentation-loader integration, and changeset files.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

  • clerk/javascript#9234: Extends the same SwingSet documentation and component story registries for another component.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding a Mosaic Menu component to ui.
Description check ✅ Passed The description matches the changeset well, covering the new Menu component, docs, icon registry updates, tests, and build details.
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.
✨ Finishing Touches 💡 1
⚔️ Resolve merge conflicts 💡
  • Resolve merge conflict in branch carp/mosaic-menu

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.changeset/mosaic-menu.md:
- Around line 1-2: Replace the empty changeset front matter in mosaic-menu.md
with an `@clerk/ui` minor release entry and add a concise summary describing the
new public Menu API.

In `@packages/swingset/src/stories/menu.component.mdx`:
- Around line 20-29: Update the Menu usage example around Menu.Item to import or
define the PlusIcon symbol before it is passed to the icon prop, ensuring the
snippet is self-contained and valid for TypeScript consumers.

In `@packages/ui/src/mosaic/components/menu/menu.tsx`:
- Around line 44-47: The default icon-only trigger in the menu component is
unnamed for assistive technology. Update the trigger around the children
fallback in packages/ui/src/mosaic/components/menu/menu.tsx:44-47 to provide a
default aria-label of “Open menu” only when children are absent, while
preserving consumer-supplied labels. Update the default-trigger test in
packages/ui/src/mosaic/components/menu/menu.test.tsx:28-36 to query it by role
and accessible name, asserting name: “Open menu”.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: ff2ea2bc-f4d7-47ec-88d7-ea1f6b2746e0

📥 Commits

Reviewing files that changed from the base of the PR and between f5d84fe and 015c270.

📒 Files selected for processing (12)
  • .changeset/mosaic-menu.md
  • packages/swingset/src/components/DocsViewer.tsx
  • packages/swingset/src/lib/registry.ts
  • packages/swingset/src/stories/menu.component.mdx
  • packages/swingset/src/stories/menu.component.stories.tsx
  • packages/ui/src/mosaic/components/menu/index.ts
  • packages/ui/src/mosaic/components/menu/menu.styles.ts
  • packages/ui/src/mosaic/components/menu/menu.test.tsx
  • packages/ui/src/mosaic/components/menu/menu.tsx
  • packages/ui/src/mosaic/icons/registry.tsx
  • packages/ui/src/mosaic/styles/index.ts
  • packages/ui/tsdown.mosaic.config.mts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go (manual)
  • clerk/dashboard (manual)
  • clerk/accounts (manual)
  • clerk/backoffice (manual)
  • clerk/clerk (manual)
  • clerk/clerk-docs (manual)
  • clerk/cloudflare-workers (manual)

Comment thread .changeset/mosaic-menu.md
Comment on lines +1 to +2
---
---

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Add an @clerk/ui release entry.

This empty changeset will omit the new public Menu API from the package release and changelog. Add an @clerk/ui minor entry with a concise feature summary.

Proposed fix
 ---
+'`@clerk/ui`': minor
 ---
+
+Add the Mosaic Menu component and menu glyphs.

As per coding guidelines, use Changesets for version management and changelogs. Based on learnings, empty changesets are only appropriate for documentation-only or non-published changes.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
---
---
---
'`@clerk/ui`': minor
---
Add the Mosaic Menu component and menu glyphs.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.changeset/mosaic-menu.md around lines 1 - 2, Replace the empty changeset
front matter in mosaic-menu.md with an `@clerk/ui` minor release entry and add a
concise summary describing the new public Menu API.

Sources: Coding guidelines, Learnings

Comment thread packages/swingset/src/stories/menu.component.mdx Outdated
Comment on lines +44 to +47
{...mergeStyleProps(themeProps('menu-trigger'), className, style)}
{...rest}
>
{children ?? <EllipsisIcon {...stylex.props(styles.triggerIcon)} />}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Make the default icon-only trigger accessible. The default trigger renders only an ellipsis glyph, leaving it unnamed for screen readers; the test currently preserves that regression.

  • packages/ui/src/mosaic/components/menu/menu.tsx#L44-L47: set a default aria-label such as Open menu when children is absent, while allowing a consumer-supplied label to override it.
  • packages/ui/src/mosaic/components/menu/menu.test.tsx#L28-L36: query the default trigger by its accessible name and assert name: 'Open menu'.

As per coding guidelines, implement proper ARIA attributes and comprehensive component tests.

📍 Affects 2 files
  • packages/ui/src/mosaic/components/menu/menu.tsx#L44-L47 (this comment)
  • packages/ui/src/mosaic/components/menu/menu.test.tsx#L28-L36
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/ui/src/mosaic/components/menu/menu.tsx` around lines 44 - 47, The
default icon-only trigger in the menu component is unnamed for assistive
technology. Update the trigger around the children fallback in
packages/ui/src/mosaic/components/menu/menu.tsx:44-47 to provide a default
aria-label of “Open menu” only when children are absent, while preserving
consumer-supplied labels. Update the default-trigger test in
packages/ui/src/mosaic/components/menu/menu.test.tsx:28-36 to query it by role
and accessible name, asserting name: “Open menu”.

Source: Coding guidelines

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/ui/src/mosaic/components/menu/menu.test.tsx`:
- Around line 61-74: Add a keyboard-focused test alongside the existing menu
interaction test, using the menu trigger to open the menu via keyboard, navigate
between items with the appropriate keys, assert the highlighted item changes in
sync with pointer behavior, and activate the selected item. Reuse the existing
renderMenu setup and accessible menu/menuitem symbols, and verify the expected
activation outcome.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: a2e5dfaa-d6f4-4457-a238-b5d20f4fb7c3

📥 Commits

Reviewing files that changed from the base of the PR and between 61b2d09 and fb372be.

📒 Files selected for processing (11)
  • .changeset/mosaic-menu.md
  • packages/swingset/src/components/DocsViewer.tsx
  • packages/swingset/src/lib/registry.ts
  • packages/swingset/src/stories/menu.component.mdx
  • packages/swingset/src/stories/menu.component.stories.tsx
  • packages/ui/src/mosaic/components/menu/index.ts
  • packages/ui/src/mosaic/components/menu/menu.styles.ts
  • packages/ui/src/mosaic/components/menu/menu.test.tsx
  • packages/ui/src/mosaic/components/menu/menu.tsx
  • packages/ui/src/mosaic/icons/registry.tsx
  • packages/ui/src/mosaic/styles/index.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go (manual)
  • clerk/dashboard (manual)
  • clerk/accounts (manual)
  • clerk/backoffice (manual)
  • clerk/clerk (manual)
  • clerk/clerk-docs (manual)
  • clerk/cloudflare-workers (manual)
🚧 Files skipped from review as they are similar to previous changes (10)
  • packages/ui/src/mosaic/components/menu/index.ts
  • packages/swingset/src/stories/menu.component.stories.tsx
  • packages/swingset/src/components/DocsViewer.tsx
  • packages/ui/src/mosaic/styles/index.ts
  • packages/swingset/src/stories/menu.component.mdx
  • packages/swingset/src/lib/registry.ts
  • packages/ui/src/mosaic/components/menu/menu.styles.ts
  • .changeset/mosaic-menu.md
  • packages/ui/src/mosaic/components/menu/menu.tsx
  • packages/ui/src/mosaic/icons/registry.tsx

Comment thread packages/ui/src/mosaic/components/menu/menu.test.tsx
Adds a StyleX-themed Menu built on the @clerk/headless menu primitive, with
swingset docs and plus/log-out glyphs in the icon registry.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
packages/ui/src/mosaic/components/menu/index.ts (1)

1-2: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Avoid the new component barrel.

Import and re-export menu.ts directly instead of adding a re-export-only index.ts.

  • packages/ui/src/mosaic/components/menu/index.ts#L1-L2: remove the barrel file.
  • packages/ui/src/mosaic/styles/index.ts#L17-L24: export from ../components/menu/menu directly.

As per coding guidelines, “Avoid barrel files (index.ts re-exports) as they can cause circular dependencies.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/ui/src/mosaic/components/menu/index.ts` around lines 1 - 2, Remove
the re-export-only packages/ui/src/mosaic/components/menu/index.ts barrel file.
Update the exports in packages/ui/src/mosaic/styles/index.ts lines 17-24 to
import directly from ../components/menu/menu, preserving the existing Menu
components and prop type exports.

Source: Coding guidelines

packages/swingset/src/stories/menu.component.stories.tsx (1)

20-37: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add an explicit return type to the exported story.

Default is an exported TypeScript function without a return annotation. Use an explicit React element type and a type-only import.

Proposed fix
 /** `@jsxImportSource` `@emotion/react` */
 import { Menu } from '`@clerk/ui/mosaic/components/menu`';
 import { iconRegistry } from '`@clerk/ui/mosaic/icons/registry`';
+import type { ReactElement } from 'react';

-export function Default() {
+export function Default(): ReactElement {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/swingset/src/stories/menu.component.stories.tsx` around lines 20 -
37, Update the exported Default story function to declare an explicit React
element return type, adding the required React type as a type-only import. Keep
the existing Menu.Root rendering and story behavior unchanged.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/swingset/src/stories/menu.component.stories.tsx`:
- Around line 11-15: Update the Menu story’s meta object to set
StoryMeta.styleEngine to the StyleX engine, alongside the existing group, title,
and source fields, so the story uses the className/style contract instead of the
default Emotion sx contract.

In `@packages/ui/src/mosaic/components/menu/menu.styles.ts`:
- Around line 6-10: Update the positioner style in the menu styles configuration
to restore the default stacking layer, using the prior z-index value or shared
overlay stacking token. Keep the existing outline reset and positioning behavior
unchanged so the default MenuContent positioner renders above page content and
common overlays.

---

Nitpick comments:
In `@packages/swingset/src/stories/menu.component.stories.tsx`:
- Around line 20-37: Update the exported Default story function to declare an
explicit React element return type, adding the required React type as a
type-only import. Keep the existing Menu.Root rendering and story behavior
unchanged.

In `@packages/ui/src/mosaic/components/menu/index.ts`:
- Around line 1-2: Remove the re-export-only
packages/ui/src/mosaic/components/menu/index.ts barrel file. Update the exports
in packages/ui/src/mosaic/styles/index.ts lines 17-24 to import directly from
../components/menu/menu, preserving the existing Menu components and prop type
exports.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: dd6d65f5-9a65-4461-8b56-82276d137504

📥 Commits

Reviewing files that changed from the base of the PR and between fb372be and 8e0ce8d.

📒 Files selected for processing (11)
  • .changeset/mosaic-menu.md
  • packages/swingset/src/components/DocsViewer.tsx
  • packages/swingset/src/lib/registry.ts
  • packages/swingset/src/stories/menu.component.mdx
  • packages/swingset/src/stories/menu.component.stories.tsx
  • packages/ui/src/mosaic/components/menu/index.ts
  • packages/ui/src/mosaic/components/menu/menu.styles.ts
  • packages/ui/src/mosaic/components/menu/menu.test.tsx
  • packages/ui/src/mosaic/components/menu/menu.tsx
  • packages/ui/src/mosaic/icons/registry.tsx
  • packages/ui/src/mosaic/styles/index.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go (manual)
  • clerk/dashboard (manual)
  • clerk/accounts (manual)
  • clerk/backoffice (manual)
  • clerk/clerk (manual)
  • clerk/clerk-docs (manual)
  • clerk/cloudflare-workers (manual)

Comment on lines +11 to +15
export const meta: StoryMeta = {
group: 'Components',
title: 'Menu',
source: 'packages/ui/src/mosaic/components/menu/menu.tsx',
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== candidate story files =="
fd 'menu\.component\.stories\.tsx$' . || true

echo "== target story =="
if [ -f packages/swingset/src/stories/menu.component.stories.tsx ]; then
  cat -n packages/swingset/src/stories/menu.component.stories.tsx
fi

echo "== locate StoryMeta/styleEngine definitions =="
rg -n "interface StoryMeta|type StoryMeta|styleEngine|function StoryMeta|export const StoryMeta|const StoryMeta" packages/swingset packages -g '*.ts' -g '*.tsx' || true

Repository: clerk/javascript

Length of output: 2864


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== StoryMeta type =="
cat -n packages/swingset/src/lib/types.ts | sed -n '1,80p'

echo "== usages of StyleX components/menu =="
rg -n "packages/ui/src/mosaic/components/menu|components/menu|`@clerk/ui/mosaic/components/menu`|style-engine: \"stylex\"|style-engine: 'stylex'|className: s" packages/ui/src/mosaic/components/menu/menu.tsx packages/ui/src/mosaic -g '*.tsx' -g '*.ts' || true

echo "== inspect menu component =="
if [ -f packages/ui/src/mosaic/components/menu/menu.tsx ]; then
  wc -l packages/ui/src/mosaic/components/menu/menu.tsx
  sed -n '1,220p' packages/ui/src/mosaic/components/menu/menu.tsx | cat -n
fi

Repository: clerk/javascript

Length of output: 8206


Mark the Menu story as StyleX-based.

StoryMeta.styleEngine is optional and defaults to 'emotion'; omitting it here makes the docs/show the Emotion sx contract even though Menu is implemented with StyleX className/style.

Proposed fix
 export const meta: StoryMeta = {
   group: 'Components',
   title: 'Menu',
   source: 'packages/ui/src/mosaic/components/menu/menu.tsx',
+  styleEngine: 'stylex',
 };
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
export const meta: StoryMeta = {
group: 'Components',
title: 'Menu',
source: 'packages/ui/src/mosaic/components/menu/menu.tsx',
};
export const meta: StoryMeta = {
group: 'Components',
title: 'Menu',
source: 'packages/ui/src/mosaic/components/menu/menu.tsx',
styleEngine: 'stylex',
};
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/swingset/src/stories/menu.component.stories.tsx` around lines 11 -
15, Update the Menu story’s meta object to set StoryMeta.styleEngine to the
StyleX engine, alongside the existing group, title, and source fields, so the
story uses the className/style contract instead of the default Emotion sx
contract.

Comment thread packages/ui/src/mosaic/components/menu/menu.styles.ts
Co-authored-by: Alex Carpenter <alex.carpenter@clerk.dev>
# Conflicts:
#	packages/swingset/src/lib/registry.ts
#	packages/ui/src/mosaic/styles/index.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/swingset/src/stories/menu.component.mdx`:
- Around line 31-41: Make the Menu usage snippet self-contained by declaring or
importing the signOut and deleteUser handlers before they are referenced by the
Menu.Item components, or remove those onClick props while preserving the
displayed menu actions.

In `@packages/ui/src/mosaic/components/menu/menu.tsx`:
- Around line 77-99: Retain the existing icon prop in MenuItemProps as
deprecated for compatibility, and update MosaicMenuItem to render the icon
before children ?? label. Document that consumers should use children for the
replacement, while preserving the current label fallback and styling behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 7d67faaf-0b78-49dd-ae42-162207b88cb8

📥 Commits

Reviewing files that changed from the base of the PR and between 8e0ce8d and 5f341d8.

📒 Files selected for processing (6)
  • .changeset/tidy-menus-wave.md
  • packages/swingset/src/stories/menu.component.mdx
  • packages/swingset/src/stories/menu.component.stories.tsx
  • packages/ui/src/mosaic/components/menu/menu.styles.ts
  • packages/ui/src/mosaic/components/menu/menu.test.tsx
  • packages/ui/src/mosaic/components/menu/menu.tsx
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • clerk/clerk_go (manual)
  • clerk/dashboard (manual)
  • clerk/accounts (manual)
  • clerk/backoffice (manual)
  • clerk/clerk (manual)
  • clerk/clerk-docs (manual)
  • clerk/cloudflare-workers (manual)

Comment thread packages/swingset/src/stories/menu.component.mdx
Comment thread packages/ui/src/mosaic/components/menu/menu.tsx
… Button

Base UI's render callback hands back DOM button props including color?: string, but Mosaic's Button omits the native color and redefines it as a token union, so spreading them failed to typecheck. Also reorders two menu.styles.ts keys to satisfy stylex sort-keys.
@austincalvelage
austincalvelage merged commit 2100e4b into main Jul 31, 2026
52 checks passed
@austincalvelage
austincalvelage deleted the carp/mosaic-menu branch July 31, 2026 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants