Skip to main content

Radio Button

A simple boolean radio button.

Examples

Plain Radio Button

<RadioButton
size="small|medium(default)"
checked
indeterminate
/>

With label

<RadioButton 
...
label="A radio button with a label"
meta="And some meta text"
/>

With Critical, Warning, Success, and Disabled States

<RadioButton
...
state="''(default)|critical|warning|success"
/>

With children

Child content only visible when checked.
Child content always visible.
Child content only visible when checked.
Child content always visible.
<RadioButton 
...
alwaysShowChildren
/>

As a list

<RadioButtonGroup
name="choice"
label="A list of radio choices"
helperText="Just pick one"
>
<RadioButton value="a" defaultChecked />
<RadioButton value="b" />
<RadioButton value="c" />
</RadioButtonGroup>

As a controlled list

<RadioButtonGroup
...
value="a"
onChange={(evt, value) => ...}
>
<RadioButton value="a" />
<RadioButton value="b" />
<RadioButton value="c" />
</RadioButtonGroup>

Props

NameTypeDefault ValueRequiredDescription
alwaysShowChildrenbooleanfalseNoShould the children display even if `checked=false`?
indeterminatebooleanfalseNoShow a partially selected checkbox when `checked=true`.
labelReactNodeNoA string or component to display as a label above the input
metaReactNodeNoA string or component to display as meta text beneath the input
onChangeFormControlChangeEventHandler<InputType, string | number | readonly string[] | (string | number | readonly string[])[]> | undefinedNoEmit a new value when the input's selected value changes.
size"small" | FormControlSize | "medium"FormControlSize.MediumNoThe size of the field
state"" | FormControlState | "critical" | "warning" | "success"FormControlState.DefaultNoThe state of the field

Enums

FormControlSize

KeyValue
Small"small"
Medium"medium"

FormControlState

KeyValue
Default""
Critical"critical"
Warning"warning"
Success"success"