Labels can be changed through the label prop. You can also hide labels by setting hideLabel to true. Hidden labels will still be available to screen readers.
The name of the hidden input element used for form submission.
required
:
boolean
=
false
Whether or not the input is required.
hideLabel
:
boolean
=
false
Define if the label should be hidden. It will still be available for screen readers.
labelPosition
:
=
'left'
Set the label position (left or right).
checked
:
boolean
=
false
Bind to the checked status of the switch.
disabled
:
boolean
=
false
Define whether or not the switch is disabled.
size
:
=
'md'
Set the size of the toggle switch. Options: 'sm' | 'md' | 'lg'.
labelStyles
:
string
=
'px-2 text-surface-900-50'
Set label styles.
background
:
string
=
'bg-surface-300-400'
Set the in-active background classes.
activeBackground
:
string
=
'bg-primary-500'
Set the active background classes.
inactiveIcon
:
string
=
''
Set the inactive icon (optional). You can also set the icon size and color here. Example: "text-surface-900 text-lg i-material-symbols-dark-mode-rounded".
activeIcon
:
string
=
''
Set the active icon (optional). You can also set the icon size and color here. Example: "text-surface-900 text-lg i-material-symbols-clear-day-rounded".