Repository navigation
refactor(segmented-control): ship as a render-prop component - #907
Merged
Merged
Conversation
- Add SegmentedControl and SegmentedControlItem in ui/segmented-control.tsx; the rendered element (Radio Group, nav and links, Toggle Group) provides the behavior - Render the sliding indicator inside SegmentedControl and share size via context like TabsList - Remove lib/segmented-control.ts and lib/segmented-control-indicator.tsx; @coss/segmented-control is now a registry:ui item and @coss/segmented-control-indicator is removed - Tabs imports the shared sizes, layout and indicator surface from the component - Migrate the radio group and navigation particles, docs, skill references, and add a changelog entry with an agent migration prompt Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
pasqualevitiello
enabled auto-merge (squash)
October 20, 2026 15:56
sean-brydon
approved these changes
Oct 21, 2026
This branch was successfully 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.
Summary
Segmented control becomes a component instead of a styling library. The element passed to
renderstill decides the behavior, so the “choose the primitive first” guidance holds.SegmentedControlrenders the indicator after its children and sharessizethrough context, likeTabsList. Items can overridesize.data-checked,aria-current="page", anddata-pressed, so thestateoption is gone.@coss/segmented-controlis nowregistry:ui, and@coss/segmented-control-indicatoris removed (its stalepublic/rJSON is deleted).@coss/tabskeeps@coss/segmented-controlas its dependency.p-radio-group-7/8/9andp-navigation-1/2/3are migrated, and navigation renders the<nav>as the root, matching the radio examples.references/primitives/segmented-control.md.Evidence
Checked in the browser on the docs page:
sm,default, andlg, in light and dark mode. The item’s own pill is suppressed while the indicator is visible.hidden, and the 4 checked radios and 3 current links carry their state attributes, so the static pill shows before hydration.registry:validate-deps,registry:build,ui:sync, andtsc --noEmitinapps/uiandpackages/uipass. Biome is clean apart from informational notes.Merge Danger
Door: two-way
The registry change can be reverted, but anyone who updates in the meantime must follow the migration.
Blast Radius: consumers
Projects with a local
lib/segmented-control.tskeep working until they update. Updating@coss/tabsthrough the CLI now pulls incomponents/ui/segmented-control.tsx. Custom compositions that use the removed exports (segmentedControlRootClassName,segmentedControlItemVariants,SegmentedControlIndicator) must migrate following the changelog entry.@coss/segmented-control-indicatorno longer resolves.