Skip to content

Radio Group

A styled radio group component for selecting a single item from a list of items.

See all the examples and details in the Storybook.

Usage

tsx
import { RadioGroup } from "@samgl/graffiti-ui";

const MyRadioGroup = () => {
  return (
    <RadioGroup
      label="What is your favourite colour?"
      items={["Red", "Orange", "Yellow", "Green", "Blue", "Purple"]}
      groupName="colors"
    />
  );
};

Props

PropTypeDefaultOptionalDescription
itemsstring[]A list of strings reprenting each item in the radio group.
groupNamestringIdentifier to tie the multiple radio buttons together.
labelstringAn optional label to display before the radio options.
classNamestringThe class name of the component, generally used when extending the component with a styled component.