Radio Group

Radio group component that allows selection of one option from a set.

Attribute Type Documentation Default Value
id :string
name :string
value :any

The current value of the radio group

default-value :any

The default value of the radio group

on-value-changed :any

Handler for value changed event

field %FormField{}

a form field struct retrieved from the form, for example: @form[:email]

class :string
rest :global
Required inner_block * :slot
<div class="flex flex-col space-y-2">
  <div class="flex items-center space-x-2">
    <.radio_group_item value="option-one" id="option-one-default" />
    <.label for="option-one-default">Option One</.label>
  </div>
  <div class="flex items-center space-x-2">
    <.radio_group_item value="option-two" id="option-two-default" />
    <.label for="option-two-default">Option Two</.label>
  </div>
</div>