Radio Group

Renders a group of radio buttons, for example for a toolbar.

Read more Read less

To render radio buttons within a regular form, use input/1 with the "radio-group" type instead.

Usage

<.radio_group
  id="favorite-dog"
  name="favorite-dog"
  label="Favorite Dog"
  options={[
    {"Labrador Retriever", "labrador"},
    {"German Shepherd", "german_shepherd"},
    {"Golden Retriever", "golden_retriever"},
    {"French Bulldog", "french_bulldog"},
    {"Beagle", "beagle"}
  ]}
/>

CSS

To target the wrapper, you can use an attribute selector:

[role="radio-group"] {}
<.radio_group id="radio-group-single-default" label="Favorite Dog" name="favorite_dog" value="golden_retriever" options={[{"Labrador Retriever", "labrador"}, {"German Shepherd", "german_shepherd"}, {"Golden Retriever", "golden_retriever"}, {"French Bulldog", "french_bulldog"}, {"Beagle", "beagle"}]}/>