Install & Download:
# Yarn
$ yarn add vue-onoff-toggle
# NPM
$ npm i vue-onoff-toggleDescription:
A themeable, customizable on/off toggle switch component for Vue.js.
Available themes:
- Default
- iOS
How to use it:
1. Import the register the component.
import OnoffToggle from 'vue-onoff-toggle'
new Vue({
components: {
OnoffToggle
},
data() {
return {
checked: false // true
}
}
})2. Add the toggle switch component to the app.
<onoff-toggle v-model="checked" />
3. Available props to config the toggle switch.
value: { type: Boolean, default: false },
theme: { type: String, default: 'default' },
name: { type: String },
disabled: { type: Boolean, default: false },
onColor: { type: String },
offColor: { type: String },
thumbColor: { type: String },
borderColor: { type: String },
width: { type: [Number, String] },
height: { type: [Number, String] },
margin: { type: [Number, String] }Preview:





