Radio Group
A roving-tabindex container for a set of fandry-radio buttons.
fandry-radio-group
Example
Link to section ExampleCustom colors and parts
Link to section Custom colors and partsThe same component with a few --fd-* tokens set around it and its parts restyled. The code is under Parts below.
Props
Link to section Props| Prop | Type | Default | Description |
|---|---|---|---|
name | string | '' | Shared name for every radio in the group. |
value | string | '' | Selected value. |
label | string | '' | Group label (rendered as the fieldset legend equivalent). |
label (slot) | slot | the label prop | Markup in place of the group label. Shown even without the label prop. |
Parts
Link to section PartsStyle the elements inside the component from your own CSS with ::part(). Every fandry component renders in native shadow DOM, so parts work on LWR and Salesforce alike. For colors, spacing, radius and type across many components, set the --fd-* tokens instead. The code for the "Custom colors and parts" example above:
| Part | Description |
|---|---|
base | The outermost element. |
label | The label. |
list | The element holding the items. |
<!-- template -->
<div class="brand">
<fandry-radio-group name="theme-shipping" value="standard" label="Shipping">
<fandry-radio name="theme-shipping" value="standard" label="Standard" checked></fandry-radio>
<fandry-radio name="theme-shipping" value="express" label="Express"></fandry-radio>
<fandry-radio name="theme-shipping" value="pickup" label="Pick up in store"></fandry-radio>
</fandry-radio-group>
</div>
/* css */
/* Scoped to this demo. Set the same --fd-* tokens on :root to theme
every fandry-* component on the site. */
.brand {
--fd-primary: 160 84% 26%;
--fd-ring-color: 160 84% 36%;
}
fandry-radio-group::part(label) {
font-size: 0.75rem;
letter-spacing: 0.06em;
text-transform: uppercase;
}
fandry-radio-group::part(list) {
flex-direction: row;
flex-wrap: wrap;
gap: 1.5rem;
}
fandry-radio::part(control) {
border-color: hsl(160 84% 26%);
}
fandry-radio::part(label) {
font-weight: 600;
}
Code
Link to section Code<fandry-radio-group name="plan" value="pro" label="Choose a plan"> <fandry-radio name="plan" value="free" label="Free"></fandry-radio> <fandry-radio name="plan" value="pro" label="Pro"></fandry-radio> <fandry-radio name="plan" value="enterprise" label="Enterprise"></fandry-radio> </fandry-radio-group>