Skip to content
Ballpoint

Radio Group

Drawn rings; choosing one inks a dot in the middle with a tight spiral.

From shadcn/ui
Built on Base UI Radio

Installation

pnpm dlx shadcn@latest add @ballpoint/radio-group

Usage

tsx
import { Label } from "@/components/ui/label"
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"

<RadioGroup defaultValue="blue">
  <Label>
    <RadioGroupItem value="blue" />
    Blue ballpoint
  </Label>
  <Label>
    <RadioGroupItem value="pencil" />
    Pencil
  </Label>
</RadioGroup>

Examples

States

A disabled option, and a group with no choice made yet and an error.

Delivery

Choose one before you continue.

Choice cards

Wrap a Field in FieldLabel and the whole row is the target.

Horizontal

The options in a row that wraps, under a heading.

Notebook size

A scale

A 1 to 5 rating with a word at each end, read back as you choose.

How did the pen feel?
ScratchySmooth

Pick one.

API reference

orientation
default "vertical"
"vertical" | "horizontal"

The options as a column, or in a row that wraps.

RadioGroupItem disabled
boolean

Dims the option and takes it out of the choice.

RadioGroupItem seed
string | number

Pins the drawing.

Every other prop goes to Base UI's Radio.

Pen settings

The drawing also takes draw, passes, weight and speed, as props or from the nearest InkProvider. What each one does.