Switch

Toggle a boolean setting between two states.

Switch

Default

Generate a switch element easily with beautiful animations and functionality

Code copied

Color

Change the color of the component when it is in active state, the allowed values ​​are (main colors of Sax Design, RGB, HEX)

Code copied

Text

Add a text to the switch with the default slot or if you need a different text for each state of the component you can use the on or off slots

Self-adjusting

The component conforms to the text to be displayed by the state in which it is located

Code copied

Icons

Add icons to the component in the default slot or the on or off status slots, and in the circle

Code copied

Loading New

Add a loading animation to the component with the loading property, the property is a boolean so you can add it without any value.

Code copied

Indeterminate New

Add an undetermined state to the compound with the indeterminate property, the property is a boolean so you can add it without any value.

Code copied

Square New

Change the circular style to square with the square property, the property is a boolean so you can add it without any value.

Code copied

Example

A usual example when using the switch component

Code copied

API

PROPS

PropertyTypeValuesDescriptiondefaultExampleMore
active-value / inactive-value / shapeString | Number | Boolean / Stringcustom bound values / rounded | squareMap switch states to custom values and choose its visual shape.true / false / rounded
v-modelBoolean, ArrayBooleanArrayDetermine the value of the component and if it is an array add or remove the value.
Usage
colorStringTheme colorsRGB y HEXChange the color of the component when it is in active state.primary
loadingBooleantruefalseAdd a loading animation to the component.
Usage
indeterminateBooleantruefalseDetermine if the component is in an undetermined state (being in this state is disabled).
Usage
SquareBooleantruefalseChange the style of the component from circular to square.
Usage
iconBooleantruefalseChange the style of the circle by making it transparent (used when adding the slot = "circle").
Usage
notValueStringStringDetermine the return value of the component when inactive.
No matching data

SLOTS

PropertyTypeValuesDescriptiondefaultExampleMore
defaultslotAdd text within the component.
Usage
onslotAdd text within the component when it is in active state.
Usage
offslotAdd text within the component when it is in idle state.
Usage
circleslotAdd an icon to the circle within the component.
Usage
No matching data
Last Updated: 2026-08-17, 08:33:54