A Vue.js component for simple switches with theme support for bulma, bootstrap and custom themes.
This is originally a fork from vue-switches, which is no longer maintained.
In this fork, We've added webpack to build the component. This allows us to offer better compatibility across different environments, optimized code performance, and more granular control over the build process.
npm install vue-toggle-switches --save
import Switches from 'vue-toggle-switches';
new Vue({
components: {
Switches
},
data () {
return {
enabled: false
}
}
};
<switches v-model="enabled"></switches>
Prop | Description |
---|---|
label | A static label to always display whether on or off. |
text-enabled | The text that displays when enabled. |
text-disabled | The text that displays when disabled. |
theme | Which theme to use. |
color | Which color to use. |
type-bold | Bigger style. |
emit-on-mount | By default, a "changed" event is emitted when the component mounts. To disable this, set this to false. |
A huge shoutout to the original vue-switches project. We've forked it and made some changes to suit our needs.
MIT
We hope the Vue community finds vue-toggle-switches beneficial. Your feedback and contributions are always welcome!
A project by Fiive.