Dinachi

Radio

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

View Source

#Installation

npx @dinachi/cli@latest add radio

#Usage

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

#Examples

#API Reference

PropTypeDefaultDescription
RadioGroup.valuestringThe controlled selected radio value.
RadioGroup.defaultValuestringThe initially selected value when uncontrolled.
RadioGroup.onValueChange(value: string, event: Event) => voidCallback fired when the selected value changes.
RadioGroup.namestringIdentifies the field when a form is submitted.
RadioGroup.disabledbooleanfalseDisables all radio options in the group.
RadioGroup.readOnlybooleanfalsePrevents the user from selecting a different radio.
RadioGroup.requiredbooleanfalseRequires a value before submitting a form.
Radio.valuestringThe unique identifying value of the radio in a group.
Radio.disabledbooleanfalseDisables a radio option.
RadioIndicator.keepMountedbooleanfalseKeeps the indicator in the DOM when the radio is inactive.