LineOne's radios, in a group that shares one name: basic or outline, plain or filled box,
circle or squircle, in every theme color.
<.radio_group field={@form[:plan]} options={[{"Free", "free"}, {"Pro", "pro"}]} color="primary" />
<.radio_group name="basic" value="primary" class="grid grid-cols-2 gap-6 sm:grid-cols-3">
<:radio value="default">Default</:radio>
<:radio value="primary" color="primary">Primary</:radio>
<:radio value="error" color="error" disabled>Error</:radio>
</.radio_group>
Summary
Functions
Renders a set of radios. Options are {label, value} tuples, plain values, or :radio
slots, which may override color, disabled and description one by one.
Functions
Renders a set of radios. Options are {label, value} tuples, plain values, or :radio
slots, which may override color, disabled and description one by one.
Attributes
field(Phoenix.HTML.FormField) - Defaults tonil.id(:string) - Defaults to the field's id.name(:string) - Defaults to the field's name.value(:any) - The value of the checked radio.options(:list) - Defaults to[].color(:string) - Defaults to"neutral". Must be one of"neutral","primary","secondary","info","success","warning", or"error".variant(:string) - Defaults to"basic". Must be one of"basic", or"outline".filled(:boolean) - Defaults tofalse.shape(:string) - Defaults to"circle". Must be one of"circle", or"squircle".size(:string) - Defaults to"md". Must be one of"xs","sm","md", or"lg".label(:string) - The caption. Defaults tonil.label_class(:any) - Classes of the caption text. Defaults tonil.help(:string) - The small line under the control. Defaults tonil.errors(:list) - Messages to show;fieldadds its own once the input was used. Defaults to[].disabled(:boolean) - Defaults tofalse.wrapper_class(:any) - Classes of the outer block (grid placement, spacing). Defaults tonil.radio_class(:any) - Extra classes of every radio input. Defaults tonil.class(:any) - Classes of the container that lays the radios out. Defaults tonil.- Global attributes are accepted. Supports all globals plus:
["form", "required"].
Slots
radio- Accepts attributes:value(:any) (required)label(:string)color(:string)disabled(:boolean)description(:string)class(:any)