Bedform UIControls

Radio Group

Select one option in a radio group.

Radio Group

*
*
boolean
*
string

Usage

import { Radio, RadioGroup } from "@bedform/ui/radio-group";

export function WorldType() {
  return (
    <RadioGroup>
      <legend>World type</legend>
      <Radio name="world" value="survival" defaultChecked>
        Survival
      </Radio>
      <Radio name="world" value="creative">
        Creative
      </Radio>
      <Radio name="world" value="hardcore" disabled>
        Hardcore
      </Radio>
    </RadioGroup>
  );
}

Behavior

RadioGroup renders a native fieldset, which groups related radio inputs, and spaces them. It accepts every fieldset attribute, such as disabled and form, and forwards its ref to the fieldset. For more information, see Radio.

Accessibility

Use a legend to name the group. All child options should share a name. For more information, see Radio.

On this page