Repository navigation
feat(ui): add the rabtx toggle and its docs page - #65
Open
shabirkhan-dev wants to merge 1 commit into
Open
shabirkhan-dev wants to merge 1 commit into
shabirkhan-dev wants to merge 1 commit into
Conversation
A native switch with a 28 by 16 track and a 12px thumb that slides on the switch spring in css only, a 24px target and a label wrapper. Values come from figma's exported svgs. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
What changed?
Toggle (Figma
6:103), an on/off switch, with a docs page at/ui/toggle.<input type="checkbox" role="switch">, so screen readers say "on" or "off". Space toggles it and forms submit it. With children it wraps a<label>; without, it needs anaria-label. The component has no hooks, so it works in server components.#e3e3e3, on#2d7cf6, disabled off#f2f2f2, disabled on#d3e4fd(new--rx-accent-softtoken; dark derived).::beforethat slides 12px on theswitchspring from the beUI table (527ms, 4% overshoot), with no JavaScript, and it is off with Motion off. An invisible::aftermakes the click area 24px tall.Why?
Owner: Toggle next.
Verification
bun run format,lint(0 warnings),typecheck,naming:check,architecture:checknext buildnot run locally (no Google Fonts in the sandbox;next/fontwas stubbed for the dev check only and not committed); left to CIappearance: none)AI-Agent Notes
#e3e3e3on white) is about 1.3:1, the same low-contrast control color as the Checkbox border and the Input, Select and Textarea borders. One darker control token would fix all five. Kept as in Figma.role="switch"withoutaria-checkedtrips a lint rule. It is suppressed on purpose, with the reason in the code: the native checkbox already exposes its state, andaria-checkedwould duplicate it and can drift out of sync.🤖 Generated with Claude Code