Implementation of radio group component from https://ui.shadcn.com/docs/components/radio-group
Examples:
<.radio_group
name="subscription"
default-value="monthly"
on-value-changed={JS.push("plan_changed")}
aria-label="Subscription"
>
<div class="flex flex-col space-y-2">
<div class="flex items-center space-x-2">
<.radio_group_item value="monthly" id="monthly" />
<.label for="monthly">Monthly</.label>
</div>
<div class="flex items-center space-x-2">
<.radio_group_item value="yearly" id="yearly" />
<.label for="yearly">Yearly</.label>
</div>
</div>
</.radio_group>Component events
:on-value-changed- Maps thevalue-changedevent. Fired when the selected item changes.
Server commands
Radio group does not support SaladUI.LiveView.send_command/4. To change the
selected value from the server, update the value assign and let LiveView re-render.
Summary
Functions
Radio group component that allows selection of one option from a set.
Individual radio button in a radio group.
Functions
Radio group component that allows selection of one option from a set.
Component events
:on-value-changed- Fired when the selected item changes.
Attributes
id(:string) - Defaults tonil.name(:string) - Defaults tonil.value(:any) - The current value of the radio group. Defaults tonil.default-value(:any) - The default value of the radio group. Defaults tonil.on-value-changed(:any) - Handler for value changed event. Defaults tonil.field(Phoenix.HTML.FormField) - a form field struct retrieved from the form, for example: @form[:email].class(:string) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)
Individual radio button in a radio group.
Attributes
id(:string) (required)value(:string) (required)disabled(:boolean) - Defaults tofalse.class(:string) - Defaults tonil.- Global attributes are accepted.