Select

Attribute Type Documentation Default Value
id :any

HTML id attribute

name :any

HTML name attribute for form submission

value :any

the currently selected value

field %FormField{}

a form field struct retrieved from the form

label :string

text label displayed above the select

options :list

list of {value, label} tuples for options

prompt :string

placeholder option text shown when no value selected

size :string

select size

"md"
variant :string

the select style variant (ghost, filled, bordered)

"bordered"
color :string

color variant

"primary"
helper :string

helper text displayed below the select

errors :list

list of error messages to display

[]
disabled :boolean

disables the select

false
horizontal :boolean

horizontal layout (label beside input)

false
state :string

validation state (applies form-group-success/warning)

multiple :boolean

allow multiple selections

false
class :any

additional CSS classes for the wrapper

label_class :any

additional CSS classes for the label

select_class :any

additional CSS classes for the select element

rest :global
inner_block :slot
<option value="">Select a category</option>
<optgroup label="Fruits">
  <option value="apple">Apple</option>
  <option value="orange">Orange</option>
  <option value="banana">Banana</option>
</optgroup>
<optgroup label="Vegetables">
  <option value="carrot">Carrot</option>
  <option value="broccoli">Broccoli</option>
  <option value="spinach">Spinach</option>
</optgroup>
<optgroup label="Grains">
  <option value="wheat">Wheat</option>
  <option value="rice">Rice</option>
  <option value="corn">Corn</option>
</optgroup>