Radio Group
One choice out of a short set of options a reader can see at once.
import { FieldGroup, FieldGroupContent, FieldGroupLegend } from '@slotted/react/field-group';import { Radio, RadioGroup } from '@slotted/react/radio-group';export default function RadioGroupBasic() { return ( <FieldGroup> <FieldGroupLegend>Delivery speed</FieldGroupLegend> <FieldGroupContent> <RadioGroup name="delivery" defaultValue="standard"> <Radio value="standard">Standard, 3 to 5 business days</Radio> <Radio value="express">Express, next business day</Radio> <Radio value="same-day">Same day, Seattle only</Radio> </RadioGroup> </FieldGroupContent> </FieldGroup> );}Installation
The packages are a 0.x beta on npm, and their public API changes between beta releases without deprecation. One line installs the binding and the default theme.
pnpm add @slotted/react @slotted/theme @slotted/themesimport { Radio, RadioGroup, RadioGroupDefaultsProvider } from '@slotted/react';Orientation
A set flows vertically by default. orientation="horizontal" lays the options in a row for short labels, such as periods or units, and the row wraps instead of scrolling when it runs out of width. The arrow keys move through the set the same way in both orientations.
import { FieldGroup, FieldGroupContent, FieldGroupLegend } from '@slotted/react/field-group';import { Radio, RadioGroup } from '@slotted/react/radio-group';export default function RadioGroupOrientation() { return ( <FieldGroup> <FieldGroupLegend>Report period</FieldGroupLegend> <FieldGroupContent> <RadioGroup orientation="horizontal" defaultValue="month"> <Radio value="day">Day</Radio> <Radio value="week">Week</Radio> <Radio value="month">Month</Radio> <Radio value="quarter">Quarter</Radio> <Radio value="year">Year</Radio> </RadioGroup> </FieldGroupContent> </FieldGroup> );}Tiles
variant="tile" frames every option and makes its whole surface the target, for a choice that needs a sentence or a price beside its name, such as a plan picker. The radio group does not arrange the tiles: put a Grid around them for equal widths and equal heights. Keyboard behavior does not change.
import { FieldGroup, FieldGroupContent, FieldGroupLegend } from '@slotted/react/field-group';import { Grid } from '@slotted/react/grid';import { Radio, RadioGroup } from '@slotted/react/radio-group';export default function RadioGroupTiles() { return ( <FieldGroup> <FieldGroupLegend>Plan</FieldGroupLegend> <FieldGroupContent> <RadioGroup name="plan" variant="tile" defaultValue="team"> <Grid minItemWidth="xs"> <Radio value="starter" description="$0 per month. Three projects and one seat."> Starter </Radio> <Radio value="team" description="$49 per month. Unlimited projects and ten seats."> Team </Radio> <Radio value="business" description="$199 per month. Single sign-on and audit logs."> Business </Radio> </Grid> </RadioGroup> </FieldGroupContent> </FieldGroup> );}Sizes
size sets the circle, the type and the spacing: sm for dense panels and toolbars, md for most forms, lg for sparse forms. Inside a field group the radio group takes the group’s size, so one prop sizes the legend and the options together.
import { FieldGroup, FieldGroupContent, FieldGroupLegend } from '@slotted/react/field-group';import { Radio, RadioGroup } from '@slotted/react/radio-group';import { Stack } from '@slotted/react/stack';export default function RadioGroupSizes() { return ( <Stack gap={5}> <FieldGroup size="sm"> <FieldGroupLegend>Count by</FieldGroupLegend> <FieldGroupContent> <RadioGroup orientation="horizontal" defaultValue="cases"> <Radio value="cases">Cases</Radio> <Radio value="units">Units</Radio> </RadioGroup> </FieldGroupContent> </FieldGroup> <FieldGroup size="md"> <FieldGroupLegend>Payment terms</FieldGroupLegend> <FieldGroupContent> <RadioGroup orientation="horizontal" defaultValue="net-30"> <Radio value="net-30">Net 30</Radio> <Radio value="net-60">Net 60</Radio> </RadioGroup> </FieldGroupContent> </FieldGroup> <FieldGroup size="lg"> <FieldGroupLegend>Account type</FieldGroupLegend> <FieldGroupContent> <RadioGroup orientation="horizontal" defaultValue="business"> <Radio value="business">Business</Radio> <Radio value="personal">Personal</Radio> </RadioGroup> </FieldGroupContent> </FieldGroup> </Stack> );}Label placement
labelPlacement="start" puts each label first and the circles in a column at the end of the row, as in a settings panel where the labels are read first. The placement is set once for the set, so the circles line up with each other.
import { FieldGroup, FieldGroupContent, FieldGroupLegend } from '@slotted/react/field-group';import { Radio, RadioGroup } from '@slotted/react/radio-group';export default function RadioGroupLabelPlacement() { return ( <FieldGroup> <FieldGroupLegend>Send the stock report</FieldGroupLegend> <FieldGroupContent> <RadioGroup labelPlacement="start" defaultValue="monday"> <Radio value="daily">Every morning</Radio> <Radio value="monday">Every Monday</Radio> <Radio value="never">Never</Radio> </RadioGroup> </FieldGroupContent> </FieldGroup> );}Descriptions
A description under one option says what that option costs or does. It joins that option’s accessible description only, so a reader on the second option hears the second sentence and not every sentence in the set.
import { FieldGroup, FieldGroupContent, FieldGroupLegend } from '@slotted/react/field-group';import { Radio, RadioGroup } from '@slotted/react/radio-group';export default function RadioGroupDescriptions() { return ( <FieldGroup> <FieldGroupLegend>Billing cycle</FieldGroupLegend> <FieldGroupContent> <RadioGroup defaultValue="monthly"> <Radio value="monthly" description="Billed on the 5th of each month. Cancel any time."> Monthly </Radio> <Radio value="yearly" description="Two months free, billed once when you subscribe."> Yearly </Radio> </RadioGroup> </FieldGroupContent> </FieldGroup> );}States
invalid sets aria-invalid on the group and draws every circle in the danger tone; the field group’s error says what is wrong. Set readOnly and disabled on the field group, which passes them to the radio group: read-only keeps every option focusable and refuses every change, and disabled takes the whole set out of the tab order and out of form submission.
import { FieldGroup, FieldGroupContent, FieldGroupDescription, FieldGroupError, FieldGroupLegend,} from '@slotted/react/field-group';import { Radio, RadioGroup } from '@slotted/react/radio-group';import { Stack } from '@slotted/react/stack';export default function RadioGroupStates() { return ( <Stack gap={6}> <FieldGroup required> <FieldGroupLegend>Payment terms</FieldGroupLegend> <FieldGroupError>Choose the payment terms for this customer.</FieldGroupError> <FieldGroupContent> <RadioGroup invalid orientation="horizontal"> <Radio value="net-30">Net 30</Radio> <Radio value="net-60">Net 60</Radio> <Radio value="prepaid">Prepaid</Radio> </RadioGroup> </FieldGroupContent> </FieldGroup> <FieldGroup readOnly> <FieldGroupLegend>Warehouse</FieldGroupLegend> <FieldGroupDescription>Stock is reserved once the order is picked.</FieldGroupDescription> <FieldGroupContent> <RadioGroup orientation="horizontal" defaultValue="seattle"> <Radio value="seattle">Seattle</Radio> <Radio value="tacoma">Tacoma</Radio> </RadioGroup> </FieldGroupContent> </FieldGroup> <FieldGroup disabled> <FieldGroupLegend>Return method</FieldGroupLegend> <FieldGroupDescription>Returns open when the order is delivered.</FieldGroupDescription> <FieldGroupContent> <RadioGroup orientation="horizontal" defaultValue="drop-off"> <Radio value="drop-off">Drop-off</Radio> <Radio value="pickup">Pickup</Radio> </RadioGroup> </FieldGroupContent> </FieldGroup> </Stack> );}Unavailable option
disabled on one Radio takes that option alone out of the set. The arrow keys skip it, and its description can say why it is unavailable.
import { FieldGroup, FieldGroupContent, FieldGroupLegend } from '@slotted/react/field-group';import { Radio, RadioGroup } from '@slotted/react/radio-group';export default function RadioGroupDisabledOption() { return ( <FieldGroup> <FieldGroupLegend>Carrier</FieldGroupLegend> <FieldGroupContent> <RadioGroup defaultValue="ups"> <Radio value="ups">UPS Ground</Radio> <Radio value="fedex">FedEx 2Day</Radio> <Radio value="dhl" disabled description="Does not deliver to Anchorage, AK."> DHL Express </Radio> </RadioGroup> </FieldGroupContent> </FieldGroup> );}Without a field group
A radio group outside a field group keeps role="radiogroup" and needs a name of its own: write aria-label, or aria-labelledby pointing at a visible heading. Inside a field group, the legend names the set and the radio group drops its role, so the set is not announced twice.
import { Radio, RadioGroup } from '@slotted/react/radio-group';export default function RadioGroupStandalone() { return ( <RadioGroup aria-label="Chart range" orientation="horizontal" size="sm" defaultValue="30"> <Radio value="7">7 days</Radio> <Radio value="30">30 days</Radio> <Radio value="90">90 days</Radio> </RadioGroup> );}Controlled
Pass value and update it from onValueChange when other parts of the screen depend on the choice. Without value, the radio group keeps the choice itself and starts from defaultValue.
import { useState } from 'react';import { FieldGroup, FieldGroupContent, FieldGroupLegend } from '@slotted/react/field-group';import { Radio, RadioGroup } from '@slotted/react/radio-group';import { Stack } from '@slotted/react/stack';const TOTALS: Record<string, string> = { usd: '$1,240.00', eur: '€1,147.00', gbp: '£982.00',};export default function RadioGroupControlled() { const [currency, setCurrency] = useState('usd'); return ( <Stack gap={4}> <FieldGroup> <FieldGroupLegend>Invoice currency</FieldGroupLegend> <FieldGroupContent> <RadioGroup orientation="horizontal" value={currency} onValueChange={setCurrency}> <Radio value="usd">USD</Radio> <Radio value="eur">EUR</Radio> <Radio value="gbp">GBP</Radio> </RadioGroup> </FieldGroupContent> </FieldGroup> <span>Invoice total: {TOTALS[currency]}</span> </Stack> );}Refusing a change
onValueChange runs before the value moves. Call cancel() on its request to keep the current option checked, then say why. Choose Starter: the workspace has more seats in use than the plan includes, so the choice stays on Team.
import { useState } from 'react';import { FieldGroup, FieldGroupContent, FieldGroupDescription, FieldGroupError, FieldGroupLegend,} from '@slotted/react/field-group';import { Radio, RadioGroup } from '@slotted/react/radio-group';const SEATS_IN_USE = 8;export default function RadioGroupRefuse() { const [notice, setNotice] = useState(''); return ( <FieldGroup> <FieldGroupLegend>Plan</FieldGroupLegend> <FieldGroupDescription>This workspace has {SEATS_IN_USE} seats in use.</FieldGroupDescription> <FieldGroupError tone="warning" live="polite" reserve> {notice} </FieldGroupError> <FieldGroupContent> <RadioGroup defaultValue="team" onValueChange={(value, request) => { if (value === 'starter') { request.cancel(); setNotice(`Starter includes one seat. Remove ${SEATS_IN_USE - 1} seats first.`); return; } setNotice(''); }} > <Radio value="starter">Starter, one seat</Radio> <Radio value="team">Team, ten seats</Radio> <Radio value="business">Business, unlimited seats</Radio> </RadioGroup> </FieldGroupContent> </FieldGroup> );}Validation on submit
A radio group with no defaultValue starts with nothing chosen. Inside a required field group it carries aria-required. Validate when the form is submitted, then set invalid and write the field group’s error; live="polite" announces the error once, and reserve keeps its line open so the options do not move. In Angular the radio group is also a form control: bind formControl, formControlName or ngModel on it, and inside a required field group its validator fails with required while nothing is chosen. Submit without a choice, then choose a reason and submit again.
import { useState, type SubmitEvent } from 'react';import { Button } from '@slotted/react/button';import { FieldGroup, FieldGroupContent, FieldGroupError, FieldGroupLegend,} from '@slotted/react/field-group';import { Inline } from '@slotted/react/inline';import { Radio, RadioGroup } from '@slotted/react/radio-group';import { Stack } from '@slotted/react/stack';export default function RadioGroupValidation() { const [reason, setReason] = useState<string | undefined>(undefined); const [submitted, setSubmitted] = useState(false); const missing = submitted && reason === undefined; const submit = (event: SubmitEvent<HTMLFormElement>) => { event.preventDefault(); setSubmitted(true); }; return ( <form noValidate onSubmit={submit}> <Stack gap={4}> <FieldGroup required> <FieldGroupLegend>Return reason</FieldGroupLegend> <FieldGroupError live="polite" reserve> {missing ? 'Choose why the order is coming back.' : ''} </FieldGroupError> <FieldGroupContent> <RadioGroup invalid={missing ? true : undefined} value={reason} onValueChange={setReason} > <Radio value="damaged">Damaged in transit</Radio> <Radio value="wrong-item">Wrong item shipped</Radio> <Radio value="not-needed">No longer needed</Radio> </RadioGroup> </FieldGroupContent> </FieldGroup> <Inline gap={3} align="center"> <Button type="submit">Request return</Button> {submitted && reason !== undefined ? <span role="status">Return requested.</span> : null} </Inline> </Stack> </form> );}Defaults for a section
A defaults provider sets orientation, labelPlacement, variant and size once for every radio group under it. A radio group that states a value of its own keeps it, and a field or field group around it decides size before the provider does.
import { FieldGroup, FieldGroupContent, FieldGroupLegend } from '@slotted/react/field-group';import { Radio, RadioGroup, RadioGroupDefaultsProvider } from '@slotted/react/radio-group';import { Stack } from '@slotted/react/stack';export default function RadioGroupDefaults() { return ( <RadioGroupDefaultsProvider orientation="horizontal"> <Stack gap={5}> <FieldGroup> <FieldGroupLegend>Status</FieldGroupLegend> <FieldGroupContent> <RadioGroup defaultValue="all"> <Radio value="all">All</Radio> <Radio value="open">Open</Radio> <Radio value="paid">Paid</Radio> <Radio value="overdue">Overdue</Radio> </RadioGroup> </FieldGroupContent> </FieldGroup> <FieldGroup> <FieldGroupLegend>Channel</FieldGroupLegend> <FieldGroupContent> <RadioGroup defaultValue="all"> <Radio value="all">All</Radio> <Radio value="online">Online</Radio> <Radio value="retail">Retail</Radio> <Radio value="wholesale">Wholesale</Radio> </RadioGroup> </FieldGroupContent> </FieldGroup> </Stack> </RadioGroupDefaultsProvider> );}Accessibility
| Key | Effect | Focus |
|---|---|---|
| Tab | moves focus into the group | the checked item, or the first item when none is checked |
| Space | checks the focused item when it is not already checked | stays on the item |
| ArrowRight | checks the next item, unchecking the previous one; wraps at the end | the newly checked item |
| ArrowDown | checks the next item, unchecking the previous one; wraps at the end | the newly checked item |
| ArrowLeft | checks the previous item, unchecking the current one; wraps at the start | the newly checked item |
| ArrowUp | checks the previous item, unchecking the current one; wraps at the start | the newly checked item |
- The radio group follows the WAI-ARIA Authoring Practices Radio Group pattern (w3.org/WAI/ARIA/apg/patterns/radio/), and the platform implements its whole keyboard table: Tab lands on the checked item, or on the first when none is checked; Space checks the focused item; the arrow keys move focus and selection together on both axes; the set wraps at both ends; disabled items are skipped. Native radios that share a name within one form provide all of it, including the arrow directions of a right-to-left document.
- This is why the items share a name, and why one is generated when none is written: the platform groups radios by name within a form, so radios without a shared name are not a set. The cost is that an unnamed radio group inside a form submits under a generated key.
- Each item takes its accessible name from its own label, through for pointing at an identifier the control generates. The group takes its name from the field group’s legend or, outside a field group, from an aria-label the consumer writes. Inside a field group the radiogroup role is withdrawn, so the set is not announced twice.
- The group writes aria-required, never the native required on an item. The native attribute turns on browser constraint validation and changes how the form submits, which describing the set must not do as a side effect. disabled is native, because the native attribute is also what makes the browser skip the option with the arrow keys.
- A radio has no native read-only state, so the radio group enforces one: it refuses the change on the click that a pointer and Space share, aria-readonly announces it on the group, and every item keeps its tab stop, its focus ring and its full contrast. The chosen option keeps its accent, because the value is real.
- The invalid state does not rely on color alone. In the high-contrast scheme the theme paints the danger border in the same color as every other border, so the circle also thickens its edge. The sentence that says what is wrong is the field group’s error.
- The target is larger than the circle. A 24-pixel square around the circle meets WCAG 2.2 SC 2.5.8 at every size and density, while the circle is 14 pixels at size="sm"; the label extends the target to the end of the text, and the hover wash covers exactly that area. The row keeps its line height: the target is drawn around the circle, not laid out beside it.
API
RadioGroup
Props
valuestring- The controlled value. When present, the consumer owns the choice for the life of the component. When absent, the radio group owns it and starts from defaultValue.
defaultValuestring- The value an uncontrolled group starts from, read once. Left unset, nothing is chosen and Tab lands on the first item, as the WAI-ARIA Authoring Practices recommend for a set with no default.
namestringDefaultgenerated- The submission name every item shares, which is what makes the platform treat the items as one set. Generated when unset, because the platform groups radios by name within a form.
variant'plain' | 'tile'Defaultplain- On RadioGroup, RadioGroupDefaultsProviderHow every item is drawn. tile frames each item and makes its whole surface the target; the inputs still share a name, so the arrow keys, the wrap and the single tab stop do not change. Arranging the tiles is left to Grid.
orientation'vertical' | 'horizontal'Defaultvertical- On RadioGroup, RadioGroupDefaultsProviderHow the choices flow. A horizontal set wraps instead of scrolling, and aria-orientation is written only where the group carries the radiogroup role.
size'sm' | 'md' | 'lg'Defaultmd- On RadioGroup, RadioGroupDefaultsProviderThe type step, passed to every item. A field or field group around the radio group decides it first, then the provider. The circle follows the control glyph scale, which the theme restates per density.
labelPlacement'end' | 'start'Defaultend- On RadioGroup, RadioGroupDefaultsProviderWhich side of its label each circle is on, set once for the set so the circles line up.
disabledbooleanDefault from the field, or false- On RadioGroup, RadioUnset rather than false. Reaches every item as the native attribute, which also makes the browser skip the item with the arrow keys. Set it on one Radio to disable that option alone.
readOnlybooleanDefault from the field, or false- Unset rather than false. A radio has no native readonly, so the radio group refuses every change and writes aria-readonly; every item keeps its tab stop, its focus ring and its contrast.
invalidbooleanDefault from the field, or false- Unset rather than false. Writes aria-invalid on the group and data-invalid on the root, which draws every circle in the danger tone with a thicker edge.
requiredbooleanDefault from the field, or false- Unset rather than false. Writes aria-required on the group, never the native required, which would turn on browser constraint validation.
value, on Radiostring- On RadioWhat this item selects, and the value the group holds when it is chosen. Required: an item with no value is a choice nobody can make.
description, on RadioReactNode- On RadioHelp text under the item’s label, wired with aria-describedby, so it describes that item and not the set.
Events
| Name | Payload | When |
|---|---|---|
onValueChange | (value: string, request: ChangeRequest<string | undefined>) | Before the value moves. request.value is the new value and request.previous the value it replaces, which is undefined while nothing is chosen, the state the WAI-ARIA Authoring Practices ask a group to start in. request.reason is pointer or keyboard, request.source is the originating event, and request.cancel() refuses the move before anything commits, including the platform’s own selection. |
onChange, onClick, onFocus, onBlur, on each Radio | the element’s own events | Whenever that item’s input fires them. Radio composes the consumer’s handler with its own instead of replacing it: the consumer’s runs first and always runs. Calling preventDefault() in onClick also stops the change. |
Composition
render(props: RadioGroupRootProps | RadioRootProps) => ReactNode- On RadioGroup, RadioReplaces either root and hands it every attribute. The props are typed as HTMLAttributes<HTMLElement>, so a set of choices can render as a ul with each item as an li. The control has no render: it holds the value and the platform’s keyboard behavior.
refRef<HTMLInputElement>- On RadioReaches the item’s input. focus() and click() are the element’s own, so there is no imperative handle.
useRadioGroup()() => RadioGroupContextValue- On inside a RadioGroupReturns what an item reads: whether it is chosen, its size, and how to request a change. It throws outside a RadioGroup instead of rendering a control that looks right and does nothing.
RadioGroupDefaultsProvider{ size, variant, orientation, labelPlacement }- On a subtreeThe four decisions an application takes once for every radio group under it. A field or field group around a radio group decides size before the provider.
rolestringDefault radiogroup, or none inside a field group- A role the consumer writes wins. Otherwise the role is radiogroup, withdrawn inside a field group, because a fieldset with a legend is already a named group and a second group named by the same legend announces the set twice.
Parts
| Part | Element | Required | Purpose |
|---|---|---|---|
root | div, or the element render returns | Yes | The group. It arranges the items, holds the value, and carries data-ui="radio-group", the four axes (data-size, data-variant, data-orientation, data-label-placement) and data-disabled, data-invalid and data-readonly. Its role is radiogroup; inside a field group the role is withdrawn, because the fieldset and its legend already name the set. |
item | div, or the element Radio’s render returns | Yes | One choice: a two-column grid holding the control, its mark, its label and its description, with data-checked and data-disabled mirrored onto it. Radio is a part of RadioGroup rather than a component of its own, because a radio outside a group has no exclusive set to belong to. |
control | input type="radio" | Yes | The native radio input. It holds the value, the name the group shares, the identifier and every native attribute written on Radio. The shared name gives the set the platform’s keyboard behavior, and ref reaches the element, so focus() needs no handle of its own. |
indicator | span | Yes | The dot, drawn as a mask from the glyph scale over the control. It is a sibling element rather than a pseudo-element, because Firefox renders neither ::before nor ::after on an input, and it takes no pointer events. |
label | label | No | Names the item’s control through for, and carries the target and the hover wash: a 24-pixel square around the circle, and a wash behind the circle and the text that stands half the control gap off the circle and half as far again past the text. It is as wide as its text, so the empty space beside it does not toggle the circle. |
description | p | No | Help text under one item’s label, aligned to the label rather than to the circle and wired with aria-describedby. It describes that item, not the set; text about the whole set belongs to the field group around it. |
Theming
Each token is a CSS custom property: set it in a theme, or on any element to retune every radio group inside it.
Radio Group tokens
| Token | Default |
|---|---|
--slotted-radio-group-active-background | var(--slotted-tone-accent-subtle-active) |
--slotted-radio-group-background | var(--slotted-surface, Canvas) |
--slotted-radio-group-border-color | var(--slotted-border-strong, ButtonBorder) |
--slotted-radio-group-border-width | var(--slotted-border-width-medium, 1.5px) |
--slotted-radio-group-checked-active-border-color | var(--slotted-tone-accent-solid-active) |
--slotted-radio-group-checked-border-color | var(--slotted-tone-accent-solid) |
--slotted-radio-group-checked-hover-border-color | var(--slotted-tone-accent-solid-hover) |
--slotted-radio-group-color | var(--slotted-text, CanvasText) |
--slotted-radio-group-description-color | var(--slotted-text-muted, GrayText) |
--slotted-radio-group-description-font-size | var(--slotted-font-size-xs, 0.75rem) |
--slotted-radio-group-disabled-background | var(--slotted-disabled-background) |
--slotted-radio-group-disabled-border-color | var(--slotted-disabled-border) |
--slotted-radio-group-disabled-color | var(--slotted-disabled-foreground) |
--slotted-radio-group-disabled-mark-color | var(--slotted-disabled-foreground) |
--slotted-radio-group-gap | var(--_gap) |
--slotted-radio-group-halo-color | var(--slotted-tone-accent-text) |
--slotted-radio-group-hover-border-color | var(--slotted-tone-accent-border) |
--slotted-radio-group-invalid-border-color | var(--slotted-tone-danger-border) |
--slotted-radio-group-invalid-checked-border-color | var(--slotted-tone-danger-solid) |
--slotted-radio-group-invalid-edge-width | var(--slotted-control-invalid-edge-width, 1px) |
--slotted-radio-group-invalid-focus-ring-color | var(--slotted-focus-ring-color-invalid, Highlight) |
--slotted-radio-group-invalid-mark-color | var(--slotted-tone-danger-solid) |
--slotted-radio-group-line-height | var(--slotted-line-height-md, 1.5) |
--slotted-radio-group-mark-color | var(--slotted-tone-accent-solid) |
--slotted-radio-group-readonly-background | /** * The ground `textarea` already gives a read-only value, and not the * sunken surface: at the `light` scheme the sunken step is #f8fafd * against a white surface, a difference a reader cannot see, so the state * existed in the accessibility tree and nowhere on screen. */ var(--slotted-tone-secondary-subtle-hover) |
--slotted-radio-group-size | var(--slotted-selection-size-md, 16px) |
--slotted-radio-group-tile-active-background | var(--slotted-tone-accent-subtle-active) |
--slotted-radio-group-tile-background | var(--slotted-surface, Canvas) |
--slotted-radio-group-tile-border-color | var(--slotted-control-border-color, ButtonBorder) |
--slotted-radio-group-tile-checked-background | var(--slotted-tone-accent-surface) |
--slotted-radio-group-tile-checked-border-color | var(--slotted-tone-accent-solid) |
--slotted-radio-group-tile-checked-hover-border-color | var(--slotted-tone-accent-solid-hover) |
--slotted-radio-group-tile-description-gap | var(--slotted-space-2, 0.25rem) |
--slotted-radio-group-tile-disabled-background | var(--slotted-disabled-background) |
--slotted-radio-group-tile-disabled-border-color | var(--slotted-disabled-border) |
--slotted-radio-group-tile-hover-background | var(--slotted-tone-accent-subtle-hover) |
--slotted-radio-group-tile-hover-border-color | var(--slotted-tone-accent-border) |
--slotted-radio-group-tile-inset | var(--slotted-control-padding-inline-sm, 10px) |
--slotted-radio-group-tile-invalid-border-color | var(--slotted-tone-danger-border) |
--slotted-radio-group-tile-invalid-checked-background | var(--slotted-tone-danger-surface) |
--slotted-radio-group-tile-invalid-checked-border-color | var(--slotted-tone-danger-solid) |
--slotted-radio-group-tile-radius | var(--slotted-radius-md, 6px) |
--slotted-radio-group-tile-readonly-background | var(--slotted-tone-secondary-subtle-hover) |
--slotted-radio-group-tile-readonly-border-color | var(--slotted-border-strong) |
Theme tokens it reads
| Token | Default |
|---|---|
--slotted-border-strong | Set per scheme by the theme |
--slotted-border-width-medium | 1.5px |
--slotted-border-width-thick | 2px |
--slotted-control-border-color | Set per scheme by the theme |
--slotted-control-border-width | var(--slotted-border-width-thin) |
--slotted-control-font-family | var(--slotted-font-family-sans) |
--slotted-control-font-size-lg | comfortable 14px · compact 13px · dense 12px |
--slotted-control-font-size-md | comfortable 13px · compact 12px · dense 12px |
--slotted-control-font-size-sm | comfortable 12px · compact 12px · dense 12px |
--slotted-control-gap-lg | comfortable 8px · compact 6px · dense 6px |
--slotted-control-gap-md | comfortable 8px · compact 6px · dense 4px |
--slotted-control-gap-sm | comfortable 6px · compact 4px · dense 4px |
--slotted-control-invalid-edge-width | var(--slotted-border-width-thin) |
--slotted-control-label-gap-lg | comfortable 12px · compact 8px · dense 8px |
--slotted-control-label-gap-md | comfortable 12px · compact 8px · dense 6px |
--slotted-control-label-gap-sm | comfortable 8px · compact 6px · dense 6px |
--slotted-control-padding-inline-lg | comfortable 16px · compact 12px · dense 10px |
--slotted-control-padding-inline-md | comfortable 13px · compact 10px · dense 8px |
--slotted-control-padding-inline-sm | comfortable 10px · compact 8px · dense 6px |
--slotted-control-shadow | Set per scheme by the theme |
--slotted-control-transition-duration | var(--slotted-duration-short) |
--slotted-control-transition-easing | var(--slotted-easing-standard) |
--slotted-disabled-background | Set per scheme by the theme |
--slotted-disabled-border | Set per scheme by the theme |
--slotted-disabled-foreground | Set per scheme by the theme |
--slotted-duration-medium | 200ms |
--slotted-focus-ring-color | Set per scheme by the theme |
--slotted-focus-ring-color-invalid | Set per scheme by the theme |
--slotted-focus-ring-offset | var(--slotted-border-width-thick) |
--slotted-focus-ring-width | var(--slotted-border-width-thick) |
--slotted-font-size-xs | 0.75rem |
--slotted-line-height-md | 1.5 |
--slotted-line-height-xs | 1.4 |
--slotted-radius-full | 9999px |
--slotted-radius-md | 6px |
--slotted-selection-halo-opacity | 0.14 |
--slotted-selection-size-lg | 18px |
--slotted-selection-size-md | 16px |
--slotted-selection-size-sm | 14px |
--slotted-space-2 | 0.25rem |
--slotted-space-3 | 0.375rem |
--slotted-surface | Set per scheme by the theme |
--slotted-target-min | 24px |
--slotted-text | Set per scheme by the theme |
--slotted-text-muted | Set per scheme by the theme |
--slotted-tone-accent-border | Set per scheme by the theme |
--slotted-tone-accent-solid | Set per scheme by the theme |
--slotted-tone-accent-solid-active | Set per scheme by the theme |
--slotted-tone-accent-solid-hover | Set per scheme by the theme |
--slotted-tone-accent-subtle-active | Set per scheme by the theme |
--slotted-tone-accent-subtle-hover | Set per scheme by the theme |
--slotted-tone-accent-surface | Set per scheme by the theme |
--slotted-tone-accent-text | Set per scheme by the theme |
--slotted-tone-danger-border | Set per scheme by the theme |
--slotted-tone-danger-solid | Set per scheme by the theme |
--slotted-tone-danger-surface | Set per scheme by the theme |
--slotted-tone-secondary-subtle-hover | Set per scheme by the theme |