Radio Groups

A styled select list that can have a single entry checked at any one time. The RadioGroup component wraps Radio components, which should be used as children.

Interactive Examples

Base

Radio Group Label

Need more examples? Find a bug?

For even more examples, please take a preview of our development environment built on the popular Storybook platform that is an always up-to-date deploy of this repository's master branch. All example code on this page can be found in the /components/radio-group/__examples__/ folder. Storybook example code can be found in /components/radio-group/__docs__/storybook-stories.jsx.

Property Details

All public, supported component props are listed below. If you believe there is a clearer way to describe a property, please submit a pull request. Property descriptions are built from source code comments (written in Markdown) located within propTypes objects which are typically found in each component's index.jsx. Pull requests to update these descriptions can easily be done without cloning this repository by clicking "Edit this file" in the Github user interface.

NameTypeRequiredDefaultDescription
assistiveTextshape

{ required: Required }

Assistive text for accessibility

  • label: This label appears in the legend.
  • required: Text to help identify the group as required
childrennode

Children are expected to be Radio components.

classNameunion

Custom CSS classes added to the node.

labelsshape

{}

Text labels for internationalization This object is merged with the default props object on every render.

  • error: Message to display when any of Checkboxes are in an error state.
  • label: This label appears above the radio group.
onChangefunc

This event fires when the radio selection changes.

disabledbool

Disable all radio inputs.

requiredbool

Adds an indicator that this field is required.

namestring

The name of this radio group.

errorIdstring

The ID of the error message, for linking to radio inputs with aria-describedby.

variantstring: base | button-group

base

Variants of radio groups such as Radio Button Group