Radio Group
Provides shared state to a series of radio buttons.
Best apple
Usage guidelines
- Form controls must have an accessible name: give them one with
<label>elements, or the Field and Fieldset parts. See Labeling a radio group.
Anatomy
Import the primitives and assemble the parts:
@using Blazix.Primitives
<RadioGroupRoot>
<RadioRoot>
<RadioIndicator />
</RadioRoot>
</RadioGroupRoot>Examples
Labeling a radio group
Label the group with aria-labelledby and a sibling label element:
<div id="storage-type-label">Storage type</div>
<RadioGroupRoot aria-labelledby="storage-type-label">...</RadioGroupRoot>An enclosing <label> is the simplest labeling pattern for each radio:
<label>
<RadioRoot Value="ssd" />
SSD
</label>RadioRoot renders a <span> with a hidden native <input> beside it.
To label a radio with a sibling <label>, point the label's for at the hidden input's
id, set with InputId:
<div id="storage-type">Storage type</div>
<RadioGroupRoot Value="ssd" aria-labelledby="storage-type">
<div>
<label for="storage-type-ssd">SSD</label>
<RadioRoot Value="ssd" InputId="storage-type-ssd">
<RadioIndicator />
</RadioRoot>
</div>
</RadioGroupRoot>API Reference
RadioGroupRoot
Renders a <div> element.
Other attributes are passed to the element it renders.
RadioRoot
Renders a <span> element.
Other attributes are passed to the element it renders.
RadioIndicator
Renders a <span> element.
Other attributes are passed to the element it renders.