Radio

A form control that allows users to select a single option from a group of mutually exclusive choices.

Installation

npx chilli@latest add radio

Default

Option 1
Option 2
Option 3

Sizes

States

With Text

Email notificationsReceive updates via email.
SMS notificationsReceive updates via text message.
No notificationsYou won't receive any notifications.

Horizontal

Daily
Weekly
Monthly

API Reference

Radio

PropTypeDefaultDescription
checkedbooleanfalseControlled checked state.
valuestringThe value of the radio when used inside a RadioGroup.
labelstringThe label text displayed next to the radio.
descriptionstringDescription text displayed below the label.
size"sm" | "md""md"The size of the radio.
disabledbooleanfalseWhether the radio is disabled.
onCheckedChange(checked: boolean) => voidCallback when the checked state changes.

RadioGroup

PropTypeDefaultDescription
valuestringThe currently selected value.
onValueChange(value: string) => voidCallback when the selected value changes.
orientation"vertical" | "horizontal""vertical"Layout direction of the radio group.