Skip to content

feat: SW-2588 add xs size to Toggle and ToggleGroup - #211

Open
boramyi-ts wants to merge 4 commits into
mainfrom
SW-2588-toggle-xs
Open

feat: SW-2588 add xs size to Toggle and ToggleGroup#211
boramyi-ts wants to merge 4 commits into
mainfrom
SW-2588-toggle-xs

Conversation

@boramyi-ts

@boramyi-ts boramyi-ts commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

SW-2588 — add xs size to Toggle & ToggleGroup

Jira: SW-2588

First slice of the input-size harmonization (full audit + proposed scale are in the ticket). Buttons already have xs / sm / default / lg; toggles only had sm / default / lg. This adds xs so Toggle matches Button's scale, and makes ToggleGroup's radius size-aware to match.

Changes

  • Toggle — new xs size: h-6 (24px), min-w-6, rounded-[min(var(--radius-md),10px)] (r8), px-1.5, text-xs, size-3 icon — mirroring Button's xs. (Toggle already matched Button at sm/md/lg; this completes it.)
  • ToggleGroup — matching data-[size=xs] container radius, and the segmented end-corners are now size-aware: xs/sm round to 8px instead of the previously hardcoded rounded-l-lg / rounded-r-lg (10px), so a small group's corners match a small Button/Toggle.

Size ladder (ToggleGroup)

xs (new) sm md lg
xs sm md lg

24px · r8 / 28px · r8 / 32px · r10 / 36px · r10 — the same ladder as Button. Single Toggle xs: toggle xs

Tests

New ExtraSmall stories for Toggle and ToggleGroup. The ToggleGroup one asserts the xs item is 24px tall with 8px end corners (guards the size-aware corners); the Toggle one asserts 24px. Full Toggle + ToggleGroup play suites pass (12/12) incl. the automatic axe check; typecheck + lint clean. Zephyr ids for the new stories to be generated via zephyr_sync.

Follow-ups (tracked in the ticket)

Select/Switch gain xs+lg; Input/Textarea/Combobox/ComboboxChips gain a size prop; Checkbox/Radio box scale; Switch/Slider track+thumb scaling. Staged as separate PRs.

🤖 Generated with Claude Code

Toggle only had sm/default/lg; add xs (h-6, r8, size-3 icon) mirroring
Button's xs so the two share a scale. ToggleGroup gains the matching xs
container radius, and its segmented end-corners are now size-aware
(rounded to 8 at xs/sm) instead of a hardcoded rounded-l-lg/rounded-r-lg,
so a small group's corners match Button/Toggle.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@boramyi-ts
boramyi-ts requested review from a team as code owners September 10, 2026 12:55
@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
ts-lib-ui-kit-storybook Ready Ready Preview Sep 10, 2026 4:39pm UTC

Request Review

@unblocked unblocked Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ No issues found

About Unblocked

Unblocked has been set up to automatically review your team's pull requests to identify genuine bugs and issues.

📖 Documentation — Learn more in our docs.

💬 Ask questions — Mention @unblocked to request a review or summary, or ask follow-up questions.

👍 Give feedback — React to comments with 👍 or 👎 to help us improve.

⚙️ Customize — Adjust settings in your preferences.

# Conflicts:
#	src/components/ui/toggle-group.tsx
@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 96.94% (🎯 83%)
🟰 ±0%
24712 / 25491
🟢 Statements 96.94% (🎯 83%)
🟰 ±0%
24712 / 25491
🟢 Functions 94.61% (🎯 74%)
🟰 ±0%
1177 / 1244
🟢 Branches 90.75% (🎯 81%)
⬇️ -0.01%
4970 / 5476
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/components/ui/toggle-group.tsx 100%
🟰 ±0%
76.47%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
src/components/ui/toggle.tsx 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
Generated in workflow #1231 for commit a1b7577 by the Vitest Coverage Report Action

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.

2 participants