Skip to content

feat(headless): add Collapsible primitive#8764

Open
alexcarpenter wants to merge 1 commit into
carp/headless-autocompletefrom
carp/headless-collapsible
Open

feat(headless): add Collapsible primitive#8764
alexcarpenter wants to merge 1 commit into
carp/headless-autocompletefrom
carp/headless-collapsible

Conversation

@alexcarpenter
Copy link
Copy Markdown
Member

@alexcarpenter alexcarpenter commented Jun 5, 2026

Summary

  • Adds Collapsible.Root, Collapsible.Trigger, and Collapsible.Panel parts following the same patterns as Accordion and Dialog
  • Panel exposes --collapsible-panel-height and --collapsible-panel-width CSS vars (measured via ResizeObserver) for CSS-driven animations
  • Full data attribute support: data-cl-open, data-cl-closed, data-cl-starting-style, data-cl-ending-style
  • Controlled (open/onOpenChange) and uncontrolled (defaultOpen) modes
  • disabled prop on Root propagates to Trigger via context
  • Suppresses enter animation on initial mount (same hasBeenClosed guard as AccordionPanel)
  • Exports wired up in package.json and vite.config.ts under @clerk/headless/collapsible

Review Stack

Review order — start at #8474 (foundation) and work up. Each PR adds one primitive on top of the previous.

# PR What it adds Base
1 #8474 Foundation (infra + hooks + utils + Dialog) main
2 #8475 Accordion #8474
3 #8476 Tabs #8475
4 #8477 cssVars + Tooltip #8476
5 #8478 Popover #8477
6 #8479 Select #8478
7 #8480 Menu #8479
8 #8481 Autocomplete + integration tests #8480
9 #8764 Collapsible #8481

Test plan

  • 25 unit tests covering slot attributes, open/close, controlled value, ARIA, animation lifecycle, disabled, and axe accessibility
  • pnpm test in packages/headless — all 377 tests pass
  • pnpm build in packages/headless — dist includes primitives/collapsible/
  • CI passes

Adds Root, Trigger, and Panel parts. Panel exposes
--collapsible-panel-height and --collapsible-panel-width CSS vars for
height/width transitions, and data-cl-open, data-cl-closed,
data-cl-starting-style, data-cl-ending-style attributes for animation
lifecycle hooks.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 5, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro

Run ID: de9ed497-7901-41aa-9da5-03c9ed8c3612

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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 and usage tips.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 5, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
clerk-js-sandbox Skipped Skipped Jun 5, 2026 6:06pm

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 5, 2026

⚠️ No Changeset found

Latest commit: c2ce0d7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

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

Click here to learn what changesets are, and how to add one.

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

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.

1 participant