Attribute Type Documentation Default Value
cva_class :string
size :string

Size of the switch, between 2xs, xs, sm

"sm"
id :string

ID of the switch, should be unique

disabled :boolean

Status Disabled of the switch

false
checked :boolean

Current of the switch, this field if inside a form field

custom_disabled_class :string

Custom class for the disabled state, use important to avoid conflicts

""
custom_enabled_class :string

Custom class for the enabled state, use important to avoid conflicts

""
label :string

Label for the switch

field %FormField{}

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

class :string

CSS class for the Switch

""
rest :global

Additional attributes for the switch

icon_checked :slot

Icon to be displayed on the switch when checked

icon_unchecked :slot

Icon to be displayed on the switch when unchecked