Radio

Radios let users choose a single option in a series of options.

Simple

Simple Radio example.

Group

Controlled radio group example

Disabled

Radio & Radio.Group allow to disabled to prevent user execute click event.

Vertical

Radio list can display in vertical.

Color

Radio & group able to apply custom css via radioClass prop.

API

Radio
PropDescriptionTypeDefault
checkedWhether the Radio is checkedboolean-
radioClassCustom css for Radiostring-
defaultCheckedWhether the Radio initial state is checkedboolean-
disabledWhether the Radio is disabledboolean-
labelRefRef of Radio label elementstring-
nameThe name of the Radio input fieldstring-
onChangeCallback when Radio value is changed(value: any, e: MouseEvent) => void-
valueValue of Radioany-
verticalDisplay Radio in verticalboolean-
Radio.Group
PropDescriptionTypeDefault
colorCustom color for all radio in the group, available colors option based on tailwind theme.colorsstringcurrent theme color
disabledWhether to disable all radiosboolean-
nameName of radios under radio groupstring-
onChangeCallback when value is changed(values: any, e: MouseEvent) => void-
valueSpecify selected value of radiosany-
verticalDisplay list of radios in verticalbooleanfalse