{"id":20969406,"url":"https://github.com/niels-bosman/vue-toggle-component","last_synced_at":"2025-05-14T09:34:23.617Z","repository":{"id":47740030,"uuid":"308061314","full_name":"niels-bosman/vue-toggle-component","owner":"niels-bosman","description":"☑️ A simple and lightweight Vue 3 checkbox based toggle component.","archived":false,"fork":false,"pushed_at":"2023-03-06T01:31:11.000Z","size":3047,"stargazers_count":11,"open_issues_count":20,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-19T15:56:28.816Z","etag":null,"topics":["toggle-button","vue","vue-components","vuejs"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/vue-toggle-component","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/niels-bosman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-28T15:33:54.000Z","updated_at":"2023-08-28T08:22:08.000Z","dependencies_parsed_at":"2023-02-09T16:01:08.616Z","dependency_job_id":null,"html_url":"https://github.com/niels-bosman/vue-toggle-component","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niels-bosman%2Fvue-toggle-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niels-bosman%2Fvue-toggle-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niels-bosman%2Fvue-toggle-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niels-bosman%2Fvue-toggle-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niels-bosman","download_url":"https://codeload.github.com/niels-bosman/vue-toggle-component/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254112692,"owners_count":22016828,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["toggle-button","vue","vue-components","vuejs"],"created_at":"2024-11-19T03:21:35.430Z","updated_at":"2025-05-14T09:34:22.868Z","avatar_url":"https://github.com/niels-bosman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"vue-toggle-component makes an ease to use, lightweight and highly customizable toggle component for [Vue.js](https://vuejs.org/). This component is available in both light and dark mode and it supports Vue 3.\n\n![npm bundle size](https://img.shields.io/bundlephobia/min/vue-toggle-component)\n![npm](https://img.shields.io/npm/dt/vue-toggle-component)\n![GitHub issues](https://img.shields.io/github/issues/niels-bosman/vue-toggle-component)\n![npm](https://img.shields.io/npm/v/vue-toggle-component)\n![GitHub Repo stars](https://img.shields.io/github/stars/niels-bosman/vue-toggle-component?style=social)\n\n![Light theme](https://user-images.githubusercontent.com/25898715/116152862-c273f400-a6e6-11eb-8b4d-1017b92d14a5.gif)\n![Dark theme](https://user-images.githubusercontent.com/25898715/116152879-c7d13e80-a6e6-11eb-87b3-9b606184ba1e.gif)\n\n## Features\n\n- **🍞 Easy:** Easy use with minimal required properties.\n- **🍤 Tiny:** Small footprint \u003c 4kb which makes your apps faster to load.\n- **✅ Accessible:** ARIA attributes in the component which makes it very accessible.\n\n## Getting Started\n### Installation\n#### Installing the package\n```sh\n# install with yarn\nyarn add vue-toggle-component\n\n# install with npm\nnpm install vue-toggle-component --save\n```\n\n### Usage\n#### Example\n```html\n\u003ctemplate\u003e\n  \u003cvue-toggle title=\"Toggle me\" name=\"vue-toggle\"/\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nimport VueToggle from 'vue-toggle-component';\n\nexport default {\n  name: 'App',\n  components: { VueToggle },\n}\n\u003c/script\u003e\n```\n\n#### Properties that vue-toggle-component uses\n| Property name | Type      | Default   | Required |Description                                                                                         |\n| ------------- | --------- | --------- | -------- | -------------------------------------------------------------------------------------------------- |\n| name          | `String`  | ❌         | ✅️        | Set's the name value of the input (checkbox). Useful for persisting data.                          |\n| title         | `String`  | ❌         | ✅        | The title that is displayed next to the toggle.                                                    |\n| activeColor   | `String`  | `#9FD6AE` | ❌        | The color that is displayed when the toggler is active.                                            |\n| darkTheme     | `Boolean` | `false`   | ❌        | Set's dark mode to active. (note that this will not change the background like in the preview GIF) |\n| disabled      | `Number`  | `false`   | ❌        | Disables the toggler.                                                                              |\n| fontSize      | `String`  | `16px`      | ❌        | Sets the font size of the text next to the toggle                                                  |\n| fontWeight    | `Boolean` | `normal`  | ❌        | Sets the font weight of the text next to the toggle.                                               |\n| toggled       | `Boolean` | `true`    | ❌        | Sets the default value for the toggler.                                                            |\n\n#### Events\nWhen you toggle the component the component emits the `toggle` event. You can use the event using the example below. The value in the event is the whether the toggler is toggled or not.\n```html\n\u003ctemplate\u003e\n  \u003cVueToggle title=\"Toggle me\" name=\"VueToggle\" @toggle=\"doSomething\"/\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nimport VueToggle from \"vue-toggle-component\";\n\nexport default {\n  name: 'App',\n  components: {\n    VueToggle\n  },\n  methods: {\n    doSomething(value) {\n      // value = true || false.\n    }\n  },\n}\n\u003c/script\u003e\n```\n\n### Vue version support\nThe main v1 version supports Vue 3.x only, for previous versions of Vue, check the following the table.\n\n| Vue version | vue-toggle-component version |\n| ----------- | ---------------------------- |\n| `2.x`       | `0.1.x`                      |\n| `3.x`       | `1.x`                        |\n\n### Authors\n#### Niels Bosman\nwww.github.com/niels-bosman\n\nhttps://nielsbosman.dev\n\n#### Mike van Egmond\nwww.github.com/mve\n\nhttps://egmond.dev\n\n### License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniels-bosman%2Fvue-toggle-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniels-bosman%2Fvue-toggle-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniels-bosman%2Fvue-toggle-component/lists"}