RadioGroup
RadioGroup is used to render a short list of mutually exclusive options.
Page navigation navigation
React
readyNot reviewed for a11y
Rails
readyNot reviewed for a11y
Figma
React examples
Default
With a caption
With a validation message
See the form pattern documentation for more information on form validation patterns.
Something went wrong
Selection required
More code examples
See the RadioGroup Storybook stories
Props
RadioGroup
Name | Required | Description |
---|---|---|
aria-labelledby | string Used when associating the input group with a label other than RadioGroup.Label | |
children | Required | RadioGroup.Label | RadioGroup.Caption | RadioGroup.Validation | FormControl |
disabled | boolean Whether the input group allows user input | |
id | string <span> The unique identifier for this input group. Used to associate the label, validation text, and caption text. <br /> You may want a custom ID to make it easier to select elements in integration tests. </span> | |
name | Required | string The name used to identify this group of radios |
onChange | (selected: string | null, e?: ChangeEvent<HTMLInputElement>) => void An onChange handler that gets called when the selection changes | |
required | boolean If true, the user must make a selection before the owning form can be submitted | |
sx | SystemStyleObject |
RadioGroup.Label
Name | Required | Description |
---|---|---|
visuallyHidden | boolean If true, the fieldset legend will be visually hidden | |
sx | SystemStyleObject |
RadioGroup.Caption
Name | Required | Description |
---|---|---|
children | React.ReactNode The caption content | |
sx | SystemStyleObject |
RadioGroup.Validation
Name | Required | Description |
---|---|---|
children | React.ReactNode The validation message | |
variant | Required | 'error' | 'success' Changes the visual style to match the validation status |
sx | SystemStyleObject |