For the complete documentation index, see llms.txt. This page is also available as Markdown.

Toggle

Toggle Props

Name
Type
Default
Description

checked

boolean

false

Defines whether the toggle input is checked or not

colors

object

Object with Tailwind CSS colors classes

colors.bgIos

string

'bg-black bg-opacity-10 dark:bg-white dark:bg-opacity-20'

colors.bgMaterial

string

'bg-md-light-surface-variant dark:bg-md-dark-surface-variant'

colors.borderMaterial

string

'border-md-light-outline dark:border-md-dark-outline'

colors.checkedBgIos

string

'bg-primary'

colors.checkedBgMaterial

string

'bg-md-light-primary dark:bg-md-dark-primary'

colors.checkedBorderMaterial

string

'border-md-light-primary dark:border-md-dark-primary'

colors.checkedThumbBgIos

string

'bg-white'

colors.checkedThumbBgMaterial

string

'bg-md-light-on-primary dark:bg-md-dark-on-primary'

colors.thumbBgIos

string

'bg-white'

colors.thumbBgMaterial

string

'bg-md-light-outline dark:bg-md-dark-outline'

component

string

'label'

Component's HTML Element

defaultChecked

boolean

false

Defines whether the toggle input is checked or not, for the case if it is uncontrolled component

disabled

boolean

false

Defines whether the toggle input is disabled or not

name

string

Toggle input name

readonly

boolean

false

Defines whether the toggle input is readonly or not

touchRipple

boolean

true

Enables touch ripple effect in Material theme

value

any

Toggle input value

Toggle Events

Name
Type
Description

change

function(e)

Toggle input change event handler

Examples

Last updated