Skip to content

feat(Switch): add size prop scale (sm / md) matching boolean control vertical rhythm (#4230)#4322

Draft
HelloOjasMutreja wants to merge 3 commits into
facebook:mainfrom
HelloOjasMutreja:feat/switch-size-prop
Draft

feat(Switch): add size prop scale (sm / md) matching boolean control vertical rhythm (#4230)#4322
HelloOjasMutreja wants to merge 3 commits into
facebook:mainfrom
HelloOjasMutreja:feat/switch-size-prop

Conversation

@HelloOjasMutreja

Copy link
Copy Markdown
Contributor

Summary

Closes #4230 (Switch: add a size prop matching the Checkbox/Radio size scale).

This PR adds a size prop ('sm' / 'md', default 'md') to Switch matching the size scale used by CheckboxInput and RadioList:

  • sm: 34px track width, 20px track height, 12px thumb (off) / 16px thumb (on). Matches 20px sm checkbox/radio control height.
  • md: 40px track width, 24px track height, 16px thumb (off) / 20px thumb (on). Matches 24px md checkbox/radio control height (default, non-breaking).

Commit Breakdown

This PR contains 3 logical commits:

  1. feat(Switch): add size prop scale (sm / md) to match boolean control vertical rhythm (#4230)
  2. docs(Switch): document size prop in Switch.doc.mjs (#4230)
  3. test(Switch): add size prop unit tests & changeset (#4230)

Test Plan

  • Ran pnpm --filter @astryxdesign/core test Switch.test.tsx (42/42 tests passing).
  • Ran pnpm check:repo to verify repository integrity.

@vercel

vercel Bot commented Jul 25, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview, Comment Jul 25, 2026 8:15am

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 25, 2026
@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge needs:design-review Affects visuals — Design should review labels Jul 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

PR Analysis Report

Modified Components

Switch
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 437 -
Complexity N/A Very High (43) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.7KB 0B

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | View full report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switch: add a size prop matching the Checkbox/Radio size scale

1 participant