Switch

Consent is required to proceed.
Attribute Type Documentation Default Value
id :any

HTML id attribute

name :any

HTML name attribute for form submission

value :any

the input value

field %FormField{}

a form field struct retrieved from the form

checked :boolean

whether the switch is toggled on

false
label :string

text label displayed next to the switch

size :string

switch size

"md"
color :string

color variant

"primary"
helper :string

helper text displayed below the switch

errors :list

list of error messages to display

[]
disabled :boolean

disables the switch

false
class :any

additional CSS classes for the wrapper

label_class :any

additional CSS classes for the label

switch_class :any

additional CSS classes for the switch input

horizontal :boolean

horizontal layout (label beside input)

false
state :string

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

multiple :boolean

appends [] to the field name for array values

false
rest :global