Skip to main content
Copy for LLM

Radio

A form control for single-select lists. Multiple radios sharing the same name form a mutually exclusive group.

Basic Usage

Radio group

With Hint

Radios with helper text per option

€9 billed each month

€90 per year — save 2 months

Card Variant

variant="card" turns each option into a bordered, fully-clickable card that highlights when selected — perfect for pricing tiers and plan pickers. The card reacts to its own input via CSS :has(), no JavaScript needed.

Inside a card, the hint stands under the name as the option's description, and the trailing slot takes what belongs at the end of the row: a price, a logo or an image. Neither becomes part of the radio's name, which stays the label. A screen reader reads the hint as the radio's description, and what trailing holds as text of the page:

Pricing-tier cards

An image in trailing, a payment provider's logo for one, takes alt="" where the name already says what it shows, as here, and an alt of its own where it adds something:

Payment methods with a logo
Payment method

The hint of a card stays in the card when the radio shows an error, which stands under the card, and the radio is described by both.

Sizes

sm, md (default), and lg scale the circle and its inner dot together, matching the size prop on Checkbox and Toggle. At every size the circle stands on the middle of the first line of its label, and a label that wraps keeps its first line beside the circle.

Radio sizes

Disabled

Disabled options

With Error

Radio group with a group-level error message
Choose a plan

Choose a plan to continue.

When validation fails, the field set around the radios shows the message once, above the options, and every radio points at it, so a screen reader hears it on whichever radio it lands. With a name the set reads the error from $errors itself; error passes one of your own. The legend names the group, the pattern WCAG recommends for a set of options.

Livewire Integration

Bind every radio in the group to the same Livewire property via wire:model.live. The radios share a name so the browser already groups them; wire:model synchronizes the chosen value back to the component.

<x-wirekit::radio name="plan" value="free" label="Free" wire:model.live="selectedPlan" />
<x-wirekit::radio name="plan" value="pro"  label="Pro"  wire:model.live="selectedPlan" />

Bound to a property declared int, float or an enum backed by int, each radio is read as a number: wire:model.live goes out as wire:model.number.live. A radio gives its value as text, and Livewire would take the server's typed answer for a change made on the server and set the group back to an earlier choice while a newer one is on its way. A property without a type, or a string one, gets the text.

Props

Prop Type Default Description
label string|null null Text next to the radio
hint string|null null Helper text below. With variant="card" it is the description under the name, inside the card. See Card Variant
help string|null null An explanation of the field, shown in a tooltip from a question mark beside the label and read as the field's description. Needs a label to stand beside. See Help beside the label
error string|false|null null Error message (also triggers aria-invalid). false shows none and leaves the $errors bag alone, see Turning an Error Off
groupError bool true Take the surrounding field.set's group error, or decline it with :group-error="false". A control that belongs to the group but neither causes the rejection nor can resolve it is then neither marked aria-invalid by the group nor described by its message; its own error, its own hint and the set's hint are unaffected
value string|BackedEnum|null null Value submitted when selected (required for grouping). A backed enum submits its value
size string 'md' Circle size — sm, md, or lg
variant string 'default' default (inline) or card (the whole bordered card is the selectable target)
loadingTarget string|null null The Livewire action whose request holds the control's busy state, as on a button: while that action is in flight the control is disabled, and any other request leaves it alone.
disableOnLoading bool true false marks the control aria-busy during that request instead of disabling it, so it keeps the focus, which a disabled control loses the moment it is disabled
scope string|null null Scoped personalization name
announceError bool|null null Render the error message in an aria-live="polite" region so a validation error that appears after render reaches a screen reader. Precedence: this prop, then the parent <x-wirekit::form :announce-errors>, then config('wirekit.a11y.announce_error'). Set false when the page runs its own live region.

The id is auto-generated as {name}-{value} when both are given, ensuring unique IDs within a radio group.

Slots

Slot Description
labelAfter Markup after the label and its help question mark, in the same row and outside both, such as a badge that says a setting is not decided yet. See A Mark After the Label.
trailing With variant="card", the end of the card's row: a price, a logo or an image. It is not part of the radio's name, and it takes no button or link, since the whole card selects the radio. Outside a card it is reported and not rendered. See Card Variant.

Accessibility

  • Native <input type="radio"> — browser provides full keyboard support:
    • Arrow keys navigate between options within the same name group
    • Space selects the focused radio
    • Tab moves focus to the first/checked radio of the next group
  • The focus ring follows the arrow keys in every browser. Safari, and every browser on iOS, does not count the focus an arrow key moves as keyboard focus, so WireKit's scripts note when an arrow key brings the focus to a radio, and the ring follows it there too, on the circle and on a card. Without @wirekitScripts on the page, Safari draws the ring after Tab and not after an arrow key.
  • The visual circle and inner dot are decorative (aria-hidden="true").
  • A card is the radio's <label>, so everything in it would be read into the radio's name. With a hint or a trailing slot, the radio takes its name from the label text alone through aria-labelledby, and the hint describes it. An aria-label or aria-labelledby of your own on the radio takes precedence.
  • For a screen-reader-announced group label, wrap related radios in <x-wirekit::field.set>. It renders a native <fieldset> with its <legend> as the first child, the WCAG-recommended pattern for grouped form controls that is announced before each radio in the set, and it resets the fieldset's default border and spacing:
<x-wirekit::field.set legend="Choose a plan" name="plan">
    <x-wirekit::radio name="plan" value="free" label="Free" />
    <x-wirekit::radio name="plan" value="pro" label="Pro" />
</x-wirekit::field.set>

With name, the set shows a validation error for plan once, above the options, and every radio points at it. Radios outside a set each render that message under themselves.

  • A choice nobody may skip takes required on the set: the legend shows the asterisk and says "(required)" to a screen reader. A radio that carries required itself also stops an empty submit in the browser, for the whole group. See A Required Group.

  • A label in another language than the page, such as a language's own name, takes lang. It goes on the label, which holds the words and the radio, so a screen reader says them in that language's voice:

<x-wirekit::field.set legend="Language" name="language">
    <x-wirekit::radio name="language" value="de" label="Deutsch" lang="de" />
    <x-wirekit::radio name="language" value="fr" label="Français" lang="fr" />
</x-wirekit::field.set>

Keyboard Interaction

Key Action
Tab Move focus into the radio group
ArrowUp / ArrowLeft Move focus and selection to the previous radio in the group
ArrowDown / ArrowRight Move focus and selection to the next radio in the group
Space Select the focused radio (when entering the group with Tab)

Pitfalls

  • Don't omit name="..." on a radio group. All radios in the same group must share name — otherwise multi-selection is possible and the form posts unexpected data.
  • Don't use a radio group for a setting that is on or off. A <x-wirekit::toggle> is the right pattern there. Radios are for two or more named choices, such as monthly or yearly billing.

Design Tokens

Token Purpose
--color-wk-accent-text Inner dot, the border of a selected radio, and the border of a chosen card (variant="card")
--color-wk-bg-input Circle background
--color-wk-border-strong / --color-wk-border-error Circle border
--color-wk-ring Focus ring

Personalization blocks

Five visual zones are resolvable through WireKit::personalize() / WireKit::scope(), and a config override under components.radio.classes.{block} reaches the same keys:

Block key Applies to
radio.base The visible circle — its border, fill and focus ring, and the step that lowers it beside a taller line
radio.label The wrapping <label> — its display mode, gap and padding (both variants)
radio.text The visible label text, and the step that lowers it beside a taller circle
radio.description The hint inside a card, under the name
radio.trailing What the trailing slot holds at the end of a card's row, and where it stands there

The label is inline-flex, so it is as wide as its content. To make a radio a full-width row with a code or a count at its edge, swap the display mode through the label block and let the text take the rest of the row through the text block, as on a checkbox.

Further Reading

Updated in WireKit v2.74.0 (2026-11-24)

Was this page helpful?

Thank you for your feedback!

Voting requires cookies or local storage. What we store