Radio group

A single-choice group with roving focus and arrow-key navigation, vertical or horizontal.

Source
1 file
Dependencies
none
Playground
no

Examples

Every variant of the shipped component, live. Switch the layout to read them as a table or one at a time, and open Code for the file behind them.

01Basic
vertical
horizontal
02Appearance
dot
solid
outline
check
03Size
sm
md
lg
04Variant
success
warning
destructive
info
05Description
06Disabled
item
group

Installation

One package for the whole library — run this once and every component on this site is importable. Adding the tokens to your stylesheet is the other half; the installation guide covers it.

npm install kipui
import { RadioGroup, RadioGroupItem } from "kipui";
Peer dependencies

react 19

react-dom 19

tailwindcss 4

Bundled dependencies

None beyond the peers above.

Usage

radio-group-example.tsx
import { RadioGroup, RadioGroupItem } from "kipui";

<RadioGroup defaultValue="monthly" onValueChange={setPlan}>
  <RadioGroupItem value="monthly">Monthly</RadioGroupItem>
  <RadioGroupItem value="yearly">Yearly</RadioGroupItem>
</RadioGroup>
  • Arrow keys move between items and select as they go — that is the expected radio behaviour, not a bug.
  • `name` makes the group submit with a surrounding form.

API reference

Transcribed from the component's own types. Props with no default are required.

RadioGroup

PropDefaultDescription
valuestringrequiredControlled selection.
defaultValuestringrequiredUncontrolled seed.
onValueChange(value: string) => voidrequiredFires with the newly selected value.
namestringrequiredForm field name for submission.
size"sm" | "md" | "lg""md"Control size.
variant"default" | "primary" | "success" | "destructive""default"Colour of the selected dot.
orientation"vertical" | "horizontal""vertical"Layout and arrow-key axis.
disabledbooleanfalseDisables every item in the group.
appearance"dot" | "check" | "filled""dot"What marks the selected item.

RadioGroupItem

PropDefaultDescription
valuestringrequiredRequired. The value this item selects.
disabledbooleanfalseSkips this item in the roving focus order.
labelstringrequiredText beside the control. Composes a label for you.
descriptionstringrequiredSecond line under the label.