About
A native-feeling radio input with the selected dial drawn on it, used as the single control inside a radio group for picking one option among several.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Radio to your project and fits it to your theme.
Code
How Radio is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client";
import Radio from "@/components/ui/radio";
export default function RadioStatesDemo() {
return (
<div className="flex w-full items-center justify-center bg-background p-10">
<div className="flex w-full max-w-md flex-wrap items-center justify-center gap-8 rounded-xl border border-border bg-card p-8 shadow-sm">
<label className="flex flex-col items-center gap-2">
<Radio name="state-unselected" />
<span className="text-xs font-medium text-muted-foreground">
unselected
</span>
</label>
<label className="flex flex-col items-center gap-2">
<Radio name="state-selected" defaultChecked />
<span className="text-xs font-medium text-muted-foreground">
selected
</span>
</label>
<label className="flex flex-col items-center gap-2">
<Radio name="state-invalid" invalid />
<span className="text-xs font-medium text-muted-foreground">
invalid
</span>
</label>
<label className="flex flex-col items-center gap-2">
<Radio name="state-disabled" disabled />
<span className="text-xs font-medium text-muted-foreground">
disabled
</span>
</label>
<label className="flex flex-col items-center gap-2">
<Radio name="state-disabled-selected" disabled defaultChecked />
<span className="text-xs font-medium text-muted-foreground">
disabled + selected
</span>
</label>
</div>
</div>
);
}
















