Custom Javascript Vue 3 Toggle Switches Component With Labels

Vueform is a comprehensive form builder for Vue.js that makes form development easy. It standardizes and handles the entire model building process, including:

  • Complete form and template design system with Tailwind support (similar to vueform libraries)
  • 25+ form elements with multiple file uploads, date picker, and rich text editor
  • Overlapping and repetition of elements
  • 50+ validators with asynchronous, dependent, and custom rules
  • Conditional logic at the element and form level
  • Split forms into steps using the Form Wizard
  • Dynamic form rendering with JSON support
  • Form content translation and global i18n support.

toggle switch javascript, jquery toggle switch with text, css toggle switch with text, toggle switch bootstrap, toggle switch html

How to make use of it:

Install and download:

# Yarn
$ yarn add @vueform/toggle

# NPM
$ npm i @vueform/toggle

1. Import and register the component.

<style src="@vueform/toggle/themes/default.css"></style>
import Toggle from '@vueform/toggle'
export default {
  components: {
    Toggle,
  }
}

2. Add the switch component to the application template.

<Toggle v-model="value" />

3. Configure the switch with the following props.

id: {
  type: [String, Number],
  required: false,
  default: 'toggle'
},
name: {
  type: [String, Number],
  required: false,
  default: 'toggle'
},
disabled: {
  type: Boolean,
  required: false,
  default: false,
},
required: {
  type: Boolean,
  required: false,
  default: false,
},
falseValue: {
  type: [String, Number, Boolean],
  required: false,
  default: false,
},
trueValue: {
  type: [String, Number, Boolean],
  required: false,
  default: true,
},
onLabel: {
  type: [String, Object],
  required: false,
  default: ''
},
offLabel: {
  type: [String, Object],
  required: false,
  default: ''
},
classes: {
  type: Object,
  required: false,
  default: () => ({})
},
labelledby: {
  type: String,
  required: false,
},
describedby: {
  type: String,
  required: false,
},

Lightweight Toggle Switches, Vueform Plugin/Github


See Demo And Download

Official Website(vueform): Click Here

This superior jQuery/javascript plugin is developed by vueform. For extra advanced usage, please go to the official website.

Related Posts

skeleton-placeholder-loading

Simple and Flexible, Content Placeholder Loading Animation

Placeholder loading is simple and flexible, CSS only, with animation for downloading OR loading content. This is a pure CSS solution to create an animated and customizable…

lazyload-embed-vimeo-player

Simple and Lightweight LazyLoad Embed Vimeo Player Plugin in Pure JavaScript

LazyLoad Embed Vimeo Player – Simple and Lightweight Plugin – Pure JavaScript. Vimeo LazyLoad is the sister project of Youtube LazyLoad that loads an on-demand Vimeo video…

agnostic-draggable

Implement Drag, Drop, and Sortable Behaviors jQuery UI | agnostic-draggable

agnostic-draggable is an undefined set of libraries that implement drag, drop, and sort behaviors inspired by jQuery UI. To enable the drag function on any DOM. Move…

Star-Rating-Plugin

Star Rating Plugin Control Based On Radio Buttons

Star Rating Radio Buttons, the star rating plugin is a plugin for the jQuery Javascript library that creates a non-intrusive star rating control based on a set…

QR-Code-With-Pure-JavaScript

A Pure QRCode Encode and Decode JavaScript Library | Decoding/Encoding

QR Code With Pure JavaScript – A pure JavaScript QRCode encode and decode library. QR code encoder and decoder instruments help you shortly generate QR codes from…

Vertical-3-Dot-Context-Menu

Simple and Lightweight Vertical 3-Dot Context Menu

The 3-dot Context Menu allows for a simple and lightweight implementation to show 3 vertical dots allowing the user to click and show a menu. Below is…