Components
Radio List
A list of options with an animated dot.
<RadioList legend="Shipping" options={options} />Installation
npx shadcn@latest add https://ui.zjkm.tech/r/radio-list.jsonimport { RadioList } from "@/components/radio-list"Using JavaScript? Set tsx: false in components.json and the CLI converts it.
New to shadcn? Run npx shadcn@latest init first. The CLI needs components.json and the @/ import alias.
Usage
A classic list of radio options with a custom dot that pops in when chosen.
import { RadioList } from "@/components/radio-list";
export function Shipping() {
return <RadioList legend="Shipping" name="shipping" options={["Standard", "Express"]} />;
}Props
| Prop | Type | Default | Description |
|---|---|---|---|
legend | string | Names the group. | |
options | string[] | The choices. | |
name | string | Form field name. | |
defaultValue | string | the first | Starting choice. |
onChange | (value: string) => void | Called when the choice changes. | |
className | string | Classes for the wrapper. |
With reduced motion, the dot appears without popping.