Skip to content

feat(mosaic): expose component props types as namespaces - #10879

Closed
alexcarpenter wants to merge 1 commit into
mainfrom
carp/mosaic-component-type-namespaces
Closed

alexcarpenter wants to merge 1 commit into
mainfrom
carp/mosaic-component-type-namespaces

Conversation

@alexcarpenter

Copy link
Copy Markdown
Member

Description

Every component in @clerk/mosaic/components/* now exposes its props type on the component itself, the way Base UI does: Avatar.Root.Props is AvatarRootProps and Badge.Props is BadgeProps. The flat type names still work.

// before
import type { AvatarProps } from '@clerk/mosaic/components/avatar';

// after
import type { Avatar, AvatarRootProps } from '@clerk/mosaic/components/avatar';
type A = Avatar.Root.Props; // same as AvatarRootProps
  • Breaking: AvatarProps, CardProps, DataListProps, EmptyStateProps, ItemProps, MenuProps and SelectProps are renamed to <Component>RootProps, with no aliases. Swingset callers are updated.
  • Parts that had no named props type now get one (for example CardHeaderProps, EntityRootProps, ItemMediaProps, ClerkLogoProps). InputGroupAddonProps stays, alongside the new InputGroupStartProps and InputGroupEndProps.
  • The namespaces are type-only declare namespace blocks. They emit no JS, and 'use client' is kept. Mosaic's oxlint config now allows them with 'typescript/no-namespace': ['error', { allowDeclarations: true }].
  • Generic parts take the same type argument, for example Select.Root.Props<Value> and Dialog.Root.Props<Payload>.
  • No State types, because Mosaic's render callback receives only props. src/features and src/primitives are unchanged.

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

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
clerk-js-sandbox Ready Ready Preview Nov 17, 2026 10:47pm UTC
mosaic-docs Error Error Nov 17, 2026 10:47pm UTC
swingset Ready Ready Preview Nov 17, 2026 10:47pm UTC

Request Review

@changeset-bot

changeset-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d195097

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

This PR includes changesets to release 2 packages
Name Type
@clerk/mosaic Minor
@clerk/swingset Patch

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

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Mosaic components now expose props types through component namespace aliases. Several components also export named prop types for individual parts. Seven root prop types are renamed, and related documentation, exports, styles, stories, and internal references use the new names. Type tests cover selected aliases. The lint configuration enables typescript/no-namespace while allowing declaration namespaces.

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

Possibly related PRs

  • clerk/javascript#10795: It changes component exports for several compound components also included here, including Avatar, DataList, EmptyState, Entity, Item, and Banner.
  • clerk/javascript#10806: It changes the export layout for compound components that receive namespace Props aliases in this pull request.

Suggested reviewers: djgould, maxyinger

Merge Risk: Minimal · up to d1950

This adds type-only props namespaces to Mosaic components and renames seven root props types, which is documented in a changeset. No concrete defect was found. The Vercel docs deployment failure should be checked to confirm it is unrelated to this change.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: component props types are exposed as namespace types (for example Avatar.Root.Props). The changeset covers this through the many namespace Props aliases and the rename…
Description check Passed The description states the change: every Mosaic component exposes its props type as a namespace member (for example Avatar.Root.Props equals AvatarRootProps). It also lists the breaking renames, the n…
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: Title check

Explanation

The title names the main change: component props types are exposed as namespace types (for example Avatar.Root.Props). The changeset covers this through the many namespace Props aliases and the renamed root props types, so the title matches the primary change. It does not mention the breaking renames, which is acceptable for a title.

Full details: Description check

Explanation

The description states the change: every Mosaic component exposes its props type as a namespace member (for example Avatar.Root.Props equals AvatarRootProps). It also lists the breaking renames, the new named part props types, the oxlint config change, and the generic part handling. These match the changeset summaries and the objectives.

Finishing Touches

Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Linked repositories: Some configured repositories could not be included in this review. Cross-repository analysis may be incomplete. Please check linked-repository access and settings.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between b27709d and d195097.

Files selected for processing: 8

  • packages/mosaic/src/components/card/index.ts
  • packages/mosaic/src/components/field/index.ts
  • packages/mosaic/src/components/switcher/switcher-avatar.tsx
  • packages/mosaic/src/components/switcher/switcher-header.tsx
  • packages/mosaic/src/components/switcher/switcher-item.tsx
  • packages/mosaic/src/components/switcher/switcher-popup.tsx
  • packages/mosaic/src/components/switcher/switcher-root.tsx
  • packages/mosaic/src/components/switcher/switcher-trigger.tsx
Linked repositories identified

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

Included review availability: This review used your included allowance. 3 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

@pkg-pr-new

pkg-pr-new Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/electron

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

@clerk/electron-passkeys

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

@clerk/eslint-plugin

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

@clerk/expo

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

@clerk/expo-biometrics

npm i https://pkg.pr.new/@clerk/expo-biometrics@10879

@clerk/expo-google-signin

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

@clerk/expo-native-components

npm i https://pkg.pr.new/@clerk/expo-native-components@10879

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/hono

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

@clerk/localizations

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

@clerk/mosaic

npm i https://pkg.pr.new/@clerk/mosaic@10879

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/react

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

@clerk/react-router

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/ui

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

@clerk/upgrade

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

@clerk/vue

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

commit: d195097

@blacksmith-sh

blacksmith-sh Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Matches Consumer types via namespaces

The namespace types, newly exported Card included, now resolve and equal their flat types, generics too. Old names like AvatarProps and CardProps now fail to import.

Merge-base

tsc

This PR d195097f

tsc

Consumer files

Also checked · 2 match

Matches Every component part has Props
Matches No runtime JS change

Proof on d195097f (from 5d5828fe) · Did Proof get it right? Yes · No

View full Proof report · React 👎 or comment @codesmith dismiss this proof to dismiss

This branch was successfully deployed

2 active deployments
Preview – swingset — d195097f Deployed Nov 17, 2026 by vercel[bot]
Preview – clerk-js-sandbox — d195097f Deployed Nov 17, 2026 by vercel[bot]
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.

1 participant