@@ -6,13 +6,11 @@ vue-toggle-component makes an ease to use, lightweight and highly customizable t
66![ npm] ( https://img.shields.io/npm/v/vue-toggle-component )
77![ GitHub Repo stars] ( https://img.shields.io/github/stars/niels-bosman/vue-toggle-component?style=social )
88
9-
109![ Light theme] ( https://user-images.githubusercontent.com/25898715/116152862-c273f400-a6e6-11eb-8b4d-1017b92d14a5.gif )
1110![ Dark theme] ( https://user-images.githubusercontent.com/25898715/116152879-c7d13e80-a6e6-11eb-87b3-9b606184ba1e.gif )
12- ## Getting Started
1311
12+ ## Getting Started
1413### Installation
15-
1614#### Installing the package
1715``` sh
1816# install with yarn
@@ -22,12 +20,11 @@ yarn add vue-toggle-component
2220npm install vue-toggle-component --save
2321```
2422
25-
2623### Usage
2724#### Example
2825``` html
2926<template >
30- <VueToggle title =" Toggle me" id = " 1 " />
27+ <VueToggle title =" Toggle me" name = " VueToggle " />
3128</template >
3229
3330<script >
@@ -43,37 +40,33 @@ export default {
4340```
4441
4542#### Properties that vue-toggle-component uses
46- | Property name | Description |
47- | ------------- | ---------------------------- |
48- | ` activeColor ` | The active color the checked toggler uses. This is a hex code. Default: ` #9FD6AE ` |
49- | ` darkTheme ` | Give this prop to the component to use the dark mode feature as shown in the GIF above. |
50- | ` id ` | The ID the input and the label use in the component. |
51- | ` name ` | The name attributes that will be set in the input. |
52- | ` title ` | The title that is shown after the toggler itself. |
53- | ` toggled ` | The value the toggler has by default, by default this is ` false ` |
43+ | Property name | Type | Default | Required | Description |
44+ | ------------- | --------- | --------- | -------- | ------------------------------------------------------------------------------- ------------------- |
45+ | name | ` String ` | - | X | Set's the name value of the input (checkbox). Useful for persisting data. |
46+ | title | ` String ` | - | X | The title that is displayed next to the toggle. |
47+ | activeColor | ` String ` | ` #9FD6AE ` | - | The color that is displayed when the toggler is active. |
48+ | darkTheme | ` Boolean ` | ` false ` | - | Set's dark mode to active. (note that this will not change the background like in the preview GIF) |
49+ | disabled | ` Boolean ` | ` false ` | - | Disables the toggler. |
50+ | toggled | ` Boolean ` | ` true ` | - | Sets the default value for the toggler. |
5451
5552### Vue version support
56-
5753The main v1 version supports Vue 3.x only, for previous versions of Vue, check the following the table.
5854
5955| Vue version | vue-toggle-component version |
6056| ----------- | ---------------------------- |
6157| ` 2.x ` | ` 0.1.x ` |
6258| ` 3.x ` | ` 1.x ` |
63- ### Authors
6459
60+ ### Authors
6561#### Niels Bosman
66-
6762www.github.com/niels-bosman
6863
6964https://nielsbosman.dev
7065
7166#### Mike van Egmond
72-
7367www.github.com/mve
7468
7569https://egmond.dev
7670
7771### License
78-
7972MIT
0 commit comments