< RadioGroup name = " defaultRadioGroup " >
< RadioGroup.Label > Choices </ RadioGroup.Label >
< FormControl >
< Radio value = " one " />
< FormControl.Label > Choice one </ FormControl.Label >
</ FormControl >
< FormControl >
< Radio value = " two " defaultChecked />
< FormControl.Label > Choice two </ FormControl.Label >
</ FormControl >
< FormControl >
< Radio value = " three " />
< FormControl.Label > Choice three </ FormControl.Label >
</ FormControl >
</ RadioGroup >
< RadioGroup name = " captionRadioGroup " >
< RadioGroup.Label > Choices </ RadioGroup.Label >
< RadioGroup.Caption > This is a caption </ RadioGroup.Caption >
< FormControl >
< Radio value = " one " />
< FormControl.Label > Choice one </ FormControl.Label >
</ FormControl >
< FormControl >
< Radio value = " two " defaultChecked />
< FormControl.Label > Choice two </ FormControl.Label >
</ FormControl >
< FormControl >
< Radio value = " three " />
< FormControl.Label > Choice three </ FormControl.Label >
</ FormControl >
</ RadioGroup >
See the form pattern documentation for more information on form validation patterns.
Choices Something went wrong < RadioGroup name = " validationRadioGroup " >
< RadioGroup.Label > Choices </ RadioGroup.Label >
< FormControl >
< Radio value = " one " defaultChecked />
< FormControl.Label > Choice one </ FormControl.Label >
</ FormControl >
< FormControl >
< Radio value = " two " />
< FormControl.Label > Choice two </ FormControl.Label >
</ FormControl >
< FormControl >
< Radio value = " three " />
< FormControl.Label > Choice three </ FormControl.Label >
</ FormControl >
< RadioGroup.Validation variant = " error " > Something went wrong </ RadioGroup.Validation >
</ RadioGroup >
< RadioGroup required name = " requiredRadioGroup " >
< RadioGroup.Label > Choices </ RadioGroup.Label >
< FormControl >
< Radio value = " one " />
< FormControl.Label > Choice one </ FormControl.Label >
</ FormControl >
< FormControl >
< Radio value = " two " defaultChecked />
< FormControl.Label > Choice two </ FormControl.Label >
</ FormControl >
< FormControl >
< Radio value = " three " />
< FormControl.Label > Choice three </ FormControl.Label >
</ FormControl >
</ RadioGroup >
See the RadioGroup Storybook stories
Loading data for radio_group...