Pick one option from a short list, with labels and descriptions. Uses native radio inputs.
import { RadioGroup, Radio } from "@kivu-ui/react"On this page
import { RadioGroup, Radio } from "@kivu-ui/react";import { Radio, RadioGroup } from "@kivu-ui/react";
export default function Demo() {
return (
<div className="grid gap-8 sm:grid-cols-2">
<RadioGroup label="Billing cycle" defaultValue="yearly">
<Radio value="monthly" label="Monthly" description="$24 per seat" />
<Radio value="yearly" label="Yearly" description="$19 per seat, billed once" />
</RadioGroup>
<RadioGroup label="Density" orientation="horizontal" defaultValue="default">
<Radio value="compact" label="Compact" />
<Radio value="default" label="Default" />
</RadioGroup>
</div>
);
}Extends <fieldset> attributes.
| Prop | Type | Default | Description |
|---|---|---|---|
label | ReactNode | - | Group label (a <legend>). |
description | ReactNode | - | Helper text. |
error | ReactNode | boolean | - | Error message. |
value / defaultValue | string | - | Selected value. |
onValueChange | (value: string) => void | - | Called when the selection changes. |
orientation | "vertical" | "horizontal" | "vertical" | Layout. |
name | string | - | Shared name for native form posts (generated if omitted). |
Extends <input> attributes.
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | - | Required. |
label | ReactNode | - | Clickable label. |
description | ReactNode | - | Text under the label. |
Every component also accepts className and forwards its ref. Root CSS class: .kivu-radio