Repository navigation
Conversation
Re-applies #755 on current main: variant="unstyled" on Toggle, ToggleGroup and ToggleGroupItem keeps the toggle behaviour and adds no classes of its own.
|
The preview deployment for registry is ready. 🟢 Open Preview | Open Build Logs | Open Application Logs Last updated at: 2026-12-03 20:23:53 CET |
|
The preview deployment for storybook is ready. 🟢 Open Preview | Open Build Logs | Open Application Logs Last updated at: 2026-12-03 20:20:40 CET |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #749
Supersedes #755. The owner can close #755 once this lands; this PR leaves it open.
Why a new branch: #755 was stacked on #720 and carried #720's 45 commits. #720 was squash-merged, so a merge of
maininto #755 would replay that history as conflicts. This branch starts frommainand re-applies only #755's own three commits (resolved onto main's currenttoggle.tsxandtoggle-group.tsx, which now usenamed(...)andUnstyledToggleGroup).Summary
Toggle,ToggleGroupandToggleGroupItemtakevariant="unstyled".aria-pressed/aria-checked, roles, group arrow-key focus,disabled,asChildand ref.flex items-center justify-center gap-1, and items drop the toggle classes.sizehas no effect.className, an unstyled part renders noclassattribute.forced-colorsclasses main added since feat(ui): add an unstyled Toggle and ToggleGroup variant #755.toggleVariants(null)still returns the default classes, as cva did.How it works
toggle.tsx: thecvacall becomesstyledToggleVariants.toggleVariantswraps it with the same call shape and returns only the caller's classes for"unstyled"(the patternButtonuses).toggle-group.tsx: the group skips its layout classes whenvariant === "unstyled". Items take the group's variant through context, so the group'svariantwins over an item's (the mdx says so).Fits main
variantgains one value.Size
Pending: the
* (every export, up front)delta againstmainis measured with the local gates, which wait for a load < 12 slot on the shared build box.Expected visual changes (for the owner, Visual Diff)
Toggle›VariantUnstyled,ToggleGroup›Unstyled.The
visual-change-approvedlabel is the owner's call; it was not applied here.Test plan
Pending: local gates are queued (load gate). This PR stays a draft until they all pass.
Type of change
feat: new APIBreaking changes
None.
variantgains one value.Checklist
main's sources (see Test plan).[Unreleased]› Added.toggle.mdxandtoggle-group.mdxupdated.any,as,@ts-ignoreoreslint-disableadded.