Checkbox & toggles
Swatch Picker
A row of colour swatches on radios: the selected one springs up with a ring in its own colour while its neighbours step aside.
React + Tailwind, shadcn-compatible: press “Copy for AI” and your Cursor or Claude Code agent installs it with the shadcn CLI.
What you can change
- the colour names through optionText — they are the captions a screen reader reads
- defaultValue — which swatch starts selected
- size — the swatch diameter in pixels
A link for your AI agent: preview, code and instructions.
Preview

Use it with AI
- 1. Copy the link.
- 2. Write to your agent in your own words and drop the link into the sentence.
- 3. The agent opens the link and installs the component from the registry.
put this on the home page as the hero:
https://vibeui.club/c/radio-020?lang=en&theme=dark
Not sure where to paste it? Step-by-step guide
Show the full instructions
What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.
Loading…
How to use
<Radio020 label="Accent colour" defaultValue="amber" />A sample call. The agent installs the component itself from the registry via the “Copy for AI” link.
Settings
- Selected colour
defaultValue· default: amber- Diameter
size· default: 34- Set name
label· default: Accent colour- Accent
accent· default: theme colour- Background
background· default: theme colour
More in Checkbox & toggles
FAQ
- How do I add Swatch Picker with Cursor or Claude Code?
- Press “Copy for AI” on this page and paste it into your agent's chat. The instruction contains the shadcn CLI install command, the dependencies and what to keep, so the agent installs this exact component instead of recreating a lookalike.
- What does Swatch Picker depend on?
- No npm packages beyond React and Tailwind CSS.
- What can I change in Swatch Picker?
- Adapt: the colour names through optionText — they are the captions a screen reader reads; defaultValue — which swatch starts selected; size — the swatch diameter in pixels. Keep as installed: the local --vibeui-radio-020-* palette — do not swap it for your theme tokens; the real radios inside the labels: they hold the selection, reach the form and answer the arrow keys; the hidden colour name in every label: a dot with no text is nameless to a screen reader, and a colour is not a name.
- Is Swatch Picker free?
- Yes. The preview is open without an account; with a free account you can copy up to 20 components a month.
For developers
npx shadcn@latest add https://vibeui.club/r/pro/radio-020.jsonThis command needs a signed link: sign in and open “Component source” below — it issues a working link valid for 30 minutes. All install options
Technical notes
One file, zero dependencies, the --vibeui-radio-020-* palette. A server component: radios inside the labels hold the selection and there is no React state. The group is a fieldset with a legend, and every swatch is a label carrying an invisible input type="radio", a dot and a hidden colour name for screen readers. The dot colour arrives through the --vibeui-radio-020-dot variable in the label's style attribute, the diameter through --vibeui-radio-020-size which the size prop sets. The selected look is assembled by :has(input:checked) selectors: a box-shadow ring on the label (its padding is the gap), transform:scale(1.18) on the dot and a checkmark growing from scale(0.4). The neighbours move 0.1875rem aside, the previous one reached by a :has(+ …) selector. The checkmark turns black or white through oklch(from …) because the swatch lightness is unknown in advance. The theme comes from color-scheme through light-dark(), while the .dark class and data-theme="dark" declare color-scheme:dark.
Tags
- radio
- swatch
- color
- has-selector
- spring
Component source
The same file your agent installs. Here in case you would rather copy it by hand.
Loading…