Radio Button

The Radio Button component allows users to select a single option from a group.

Usage

Default


  const options = ["a", "b", "c"];

  const [selected, setSelected] = useState("b");

  <div style={{ display: "flex", gap: "1rem" }}>
          {options.map((opt) => (
            <RadioButton
              key={opt}
              theme="secondary"
              label={Option}
              value={opt}
              checked={selected === opt}
              onChange={setSelected}
            />
          ))}
  </div>

Props

Sortable data table
PropTypeDefaultDescription
labelstring-Label displayed next to the radio button.
valuestring-The value for the radio button input.
checkedboolean-Determines if the radio button is selected.
onChange(value: string) => void-Callback fired when the selected value changes.
theme"primary" | "secondary" | "tertiary" | "quaternary" | "clear"Configured DefaultTheme variant for styling the radio button.
rounding"none" | "small" | "medium" | "large"Configured DefaultBorder radius applied to the radio button.
shadow"none" | "light" | "medium" | "strong" | "intense"Configured DefaultShadow depth applied to the radio button.
state"success" | "error" | "warning"-Visual state (e.g., success, error, warning) for styling.
disabledbooleanfalseDisables the radio button if true.
classNamestring-Custom class name for the wrapper element.
data-testidstring"radio-button"Test ID for selecting the component in tests.