Radio group for exclusive single selection. Mirrors Fluxon's radio_group/1
as radio/1 so templates call <.radio>.
<.radio name="plan" value={@plan} label="Plan">
<:radio value="basic" label="Basic" />
<:radio value="pro" label="Pro" sublabel="Popular" />
</.radio>
<.radio field={@form[:tier]} variant="cards" label="Tier">
<:radio value="free" label="Free" description="Hobby projects" />
<:radio value="team" label="Team" description="Collaboration" />
</.radio>
Summary
Functions
Attributes
id(:any) - Element id; derived from field or name when omitted. Defaults tonil.name(:string) - Shared radio name; derived from field when omitted. Defaults tonil.value(:any) - Currently selected option value. Defaults tonil.label(:string) - Group label above the options. Defaults tonil.sublabel(:string) - Secondary line under the group label. Defaults tonil.description(:string) - Helper text under the group label. Defaults tonil.errors(:list) - Validation messages; derived from field when used. Defaults to[].variant(:string) - list is compact radios; cards is selectable panels. Defaults to"list". Must be one of"list", or"cards".class(:any) - Extra classes merged onto the root element. Defaults tonil.field(Phoenix.HTML.FormField) - Form field; derives id, name, value, and errors. Defaults tonil.disabled(:boolean) - Render disabled and non-interactive. Defaults tofalse.- Global attributes are accepted. Arbitrary HTML/
phx-*attributes passed through.
Slots
radio(required) - One exclusive option in the group. Accepts attributes:value(:any) (required) - Option value submitted when selected.label(:string) - Primary label for this option.sublabel(:string) - Secondary label for this option.description(:string) - Helper text under this option's labels.disabled(:boolean) - Disable this option only.