Skip to content

Switch - Usage

The Switch component allows users to toggle between two states.

AndroidreleasedElementsreleasediOSreleasedReactreleasedVuereleased

Vue

Import

Use in entire app

js
import { Switch } from '@warp-ds/vue';
app.use(Switch);

Use in one component and special imports

You can import the component like so:

js
import { wSwitch } from '@warp-ds/vue';

or import it individually to optimize your JS bundle size by adding only the components you need:

js
import { wSwitch } from '@warp-ds/vue/switch';

Syntax

vue
<w-switch v-model="model" />

Props

Required props

NameTypeDefaultDescription
v-modelbooleanfalseThe value of the switch.

Optional Props

NameTypeDefaultDescription
idstringfalseThe unique identifier.
disabledbooleanfalseWhether the switch is disabled.

Questions?

Feel free to ask any questions on usage in the Warp DS Slack channel: #warp-design-system