Socket
Book a DemoInstallSign in
Socket

@pderas/vue2-toggle

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pderas/vue2-toggle

A vue 2 component for a toggle input

1.2.1
latest
Source
npmnpm
Version published
Weekly downloads
8
Maintainers
3
Weekly downloads
 
Created
Source

Vue Toggle

A vue.js component for a toggle input.

How to initialize Vue Toggle

Vue toggle is built as a vue plugin. It can be initialized just as the Vue documentation states.

import Toggle from "@pderas/vue2-toggle";

// defaults
Vue.use(Toggle, {
    altColor:   '#ccc',
    color:      '#2196F3',
    labels:     {
        true_label:     'On',
        false_label:    'Off'
    },
    useLabels:  true,
    type:       'round'
});

Usage

Creation

A vue toggle is easily created and can be bound to data with v-model.

<toggle></toggle>

Properties

PropertyRequiredTypeDefaultDescription
alt-colorfalseString'#ccc'The color of the toggle when unchecked
colorfalseString'#2196F3'The color of the toggle when checked
labelsfalseObject{ true_label: 'on', false_label: 'off' }The labels to use when use-labels is enabled
typefalseString'round'The type of style to use for the toggle
use-labelsfalseBooleantrueUse on/off labels on the toggle
valuefalseBooleanfalseValue for the input, can be used with v-model
Available Types
  • round
  • rectangle

Styling

Styling is currently limited, but can be expanded in the future.

License

This project is covered under the MIT License. Feel free to use it wherever you like.

Keywords

vue2

FAQs

Package last updated on 25 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.