PhoenixDuskmoon.Component.Form.Radio (PhoenixDuskmoon v7.2.1)
View SourceRadio button component for single selection.
Examples
<.dm_form for={@form} phx-submit="save">
<.dm_radio field={@form[:theme]} value="light" label="Light theme" />
<.dm_radio field={@form[:theme]} value="dark" label="Dark theme" color="secondary" />
<.dm_radio field={@form[:theme]} value="auto" label="Auto theme" size="lg" />
</.dm_form>Attributes
field- Phoenix form fieldvalue- Radio button valuelabel- Radio button label textsize- Radio size: xs, sm, md, lg (default: md)color- Radio color: primary, secondary, accent, info, success, warning, error (default: primary)disabled- Disable the radio buttonclass- Additional CSS classeslabel_class- Additional CSS classes for labelradio_class- Additional CSS classes for radio element
Summary
Functions
Attributes
id(:any) - Defaults tonil.name(:any)value(:any)field(Phoenix.HTML.FormField) - a form field struct retrieved from the form.checked(:boolean) - Defaults tofalse.label(:string) - Defaults tonil.size(:string) - Defaults to"md". Must be one of"xs","sm","md", or"lg".color(:string) - Defaults to"primary". Must be one of"primary","secondary","accent","info","success","warning", or"error".disabled(:boolean) - Defaults tofalse.class(:string) - Defaults tonil.label_class(:string) - Defaults tonil.radio_class(:string) - Defaults tonil.- Global attributes are accepted.