Vivid API

Switch

Use a Switch when you want a user to easily toggle between two mutually exclusive options, like 'on' and 'off' typically for settings or preferences within an application.

Label

The label attribute adds a label to the Switch.

If a visible label can’t be used, provide one using the

aria-label

attribute. This ensures screen readers announce the purpose of the element, making it accessible to all users.

Checked

The checked attribute controls the checked state of the Switch.

Connotation

The connotation attribute controls the color of the switch.

Disabled

The disabled attribute sets the disabled state of the Switch.

Readonly

The readonly attribute sets the readonly state of the Switch.