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 space-x-6">
  <div class="flex items-center space-x-2">
    <.radio_group_item value="option-one" id="option-one-horizontal" />
    <.label for="option-one-horizontal">Option One</.label>
  </div>
  <div class="flex items-center space-x-2">
    <.radio_group_item value="option-two" id="option-two-horizontal" />
    <.label for="option-two-horizontal">Option Two</.label>
  </div>
  <div class="flex items-center space-x-2">
    <.radio_group_item value="option-three" id="option-three-horizontal" />
    <.label for="option-three-horizontal">Option Three</.label>
  </div>
</div>