A group of mutually exclusive options, rendered as selectable cards.
A port of the Pines radio group.
<.radio_group name="plan" value={@plan}>
<:option value="hobby" title="Hobby" description="Up to 3 projects" />
<:option value="pro" title="Pro" description="Unlimited projects" />
</.radio_group>Built on real <input type="radio"> elements, so arrow-key navigation, form submission and
screen-reader semantics all come from the browser. No JavaScript at all.
Summary
Forms
Renders a card-style radio group.
Forms
Renders a card-style radio group.
Accessibility
The <fieldset>/<legend> pairing is what tells assistive technology these radios belong
together and what the group is called — which is why the group label is a <legend> rather
than a floating <div>.
Attributes
id(:string) - Defaults tonil.name(:string) (required)value(:any) - The currently selected option's value. Defaults tonil.label(:string) - Accessible name for the whole group. Defaults tonil.hint(:string) - Defaults tonil.error(:string) - Defaults tonil.disabled(:boolean) - Defaults tofalse.columns(:integer) - Grid columns at thesmbreakpoint and up. Defaults to1.class(:string) - Defaults tonil.- Global attributes are accepted.
Slots
option(required) - Accepts attributes:value(:any) (required)title(:string) (required)description(:string)disabled(:boolean)