Radio

Sketch circle with a solid inner dot when selected. Must live inside RadioGroup. The ring draws in on mount; the dot scales and draws in on select.

<RadioGroup defaultValue="pen">
  <Radio value="pen" label="Pen" roughness={1.5} />
  <Radio value="pencil" label="Pencil" roughness={1.5} />
</RadioGroup>

CLI install

npx doodleui-react add radio

Usage

import { RadioGroup, Radio } from "doodleui-react";

<RadioGroup defaultValue="pen">
  <Radio value="pen" label="Pen" />
  <Radio value="pencil" label="Pencil" />
</RadioGroup>

Props

RadioGroup accepts the Radix root API (value, onValueChange, orientation, disabled). Sketch props live on each Radio.

PropTypeDefaultNotes
valuestringrequiredValue within RadioGroup.
labelReactNodeundefinedCaption sitting to the right of the circle.
animatebooleantrueDraw-in the ring on mount. Dot scales and draws in on select. Overrides DoodleUIProvider. Reduced motion disables this unless the provider set forceAnimate.
roughnessnumber1.5How wobbly the stroke is. 0 is almost geometric. 3+ is messy.
seednumberprovider / randomLocks the sketch. Omit to follow SketchSeedProvider (Shuffle) or a mount-time random seed.
sketchColorstring#1f1d1aStroke color. Also tints primary/accent fills where relevant.
classNamestringundefinedPassed through to the root element.
styleCSSPropertiesundefinedPassed through to the root element.