RadioGroup

The RadioGroup component groups multiple Radio components together, ensuring only one can be selected at a time.

Import

<script>
  import { RadioGroup, Radio } from 'svelte-fluentui';
</script>
svelte

Basic Usage

<RadioGroup label="Choose size" name="size">
  <Radio value="small">Small</Radio>
  <Radio value="medium">Medium</Radio>
  <Radio value="large">Large</Radio>
</RadioGroup>
svelte

With Default Selection

<RadioGroup label="Theme" name="theme" value="light">
  <Radio value="light">Light</Radio>
  <Radio value="dark">Dark</Radio>
  <Radio value="auto">Auto</Radio>
</RadioGroup>
svelte

Properties

PropertyTypeDefaultDescription
labelstringundefinedLabel for the radio group
namestringundefinedName attribute for all child radios
valuestringundefinedCurrently selected value
disabledbooleanfalseWhether the entire group is disabled
requiredbooleanfalseWhether a selection is required

Events

EventDescription
on:changeFired when the selected value changes