Skip to content

feat(components): add optional hideLabels and variant props to Switch#1917

Open
maheskett wants to merge 2 commits into
mainfrom
maheskett/feat/switch-hide-labels-and-primary-variant
Open

feat(components): add optional hideLabels and variant props to Switch#1917
maheskett wants to merge 2 commits into
mainfrom
maheskett/feat/switch-hide-labels-and-primary-variant

Conversation

@maheskett
Copy link
Copy Markdown

@maheskett maheskett commented Jun 3, 2026

Summary

Minor change to the Switch component to add an optional hideLabels prop to hide On/Off text, and an optional variant prop with a primary option for a blue selected state.

Screenshots (if appropriate):

Screenshot 2026-06-03 at 1 22 47 PM Screenshot 2026-06-03 at 1 22 27 PM


Note

Low Risk
Optional UI props with default behavior unchanged; no auth, data, or breaking API changes.

Overview
Switch gains two optional presentation props while keeping default behavior unchanged.

hideLabels suppresses the built-in On/Off text and applies a narrower compact track; selected-state handle motion is adjusted for the smaller width. variant="primary" styles the selected track with the interactive primary (blue) tokens instead of the default green.

Styling is wired through CVA on switchStyles; SwitchVariants is exported from the package. Tests, Storybook stories, and a minor changeset cover the new API.

Reviewed by Cursor Bugbot for commit 2a8748e. Bugbot is set up for automated code reviews on this repo. Configure here.


Open in Devin Review

@maheskett maheskett requested a review from a team as a code owner June 3, 2026 20:24
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 3, 2026

🦋 Changeset detected

Latest commit: 2a8748e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@launchpad-ui/components Minor

Not sure what this means? Click here to learn what changesets are.

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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Jun 3, 2026

yarn add https://pkg.pr.new/@launchpad-ui/components@1917.tgz
yarn add https://pkg.pr.new/@launchpad-ui/icons@1917.tgz
yarn add https://pkg.pr.new/@launchpad-ui/tokens@1917.tgz

commit: 2a8748e

cursor[bot]

This comment was marked as resolved.

@maheskett maheskett requested a review from nhironaka June 3, 2026 22:52
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

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