Skip to Content
zjkm-ui
Components

Radio List

A list of options with an animated dot.

Shipping
Props
<RadioList legend="Shipping" options={options} />

Installation

npx shadcn@latest add https://ui.zjkm.tech/r/radio-list.json
import { 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

PropTypeDefaultDescription
legendstringNames the group.
optionsstring[]The choices.
namestringForm field name.
defaultValuestringthe firstStarting choice.
onChange(value: string) => voidCalled when the choice changes.
classNamestringClasses for the wrapper.

With reduced motion, the dot appears without popping.

On this page