Dinachi

Radio

A radio input and group for selecting a single option from a set.

#Installation

npx @dinachi/cli@latest add radio

#Usage

tsx
import { Radio, RadioGroup } from "@/components/ui/radio"

#Examples

Default Radio

A basic radio group with preset options

Controlled Radio

Radio group with controlled state and value display

Selected: email

Disabled Radio

Radio group in disabled state

#API Reference

PropTypeDefaultDescription
RadioGroup.valuestringThe controlled selected radio value.
RadioGroup.defaultValuestringThe initially selected value when uncontrolled.
RadioGroup.onValueChange(value: string) => voidCallback fired when the selected value changes.
Radio.disabledbooleanfalseDisables a radio option.
Radio.requiredbooleanfalseMarks a radio option as required.