vcf-toggle-button: # <vcf-toggle-button>
Demo
https://vcf-toggle-button.netlify.com/
Installation
Install vcf-toggle-button:
npm i @vaadin-component-factory/vcf-toggle-button --save
Usage
Once installed, import it in your application:
import '@vaadin-component-factory/vcf-toggle-button/vcf-toggle-button.js';
And use it:
<vcf-toggle-button></vcf-toggle-button>
Attributes
label: Provide a label for the toggle button.checked: Changes the state of toggle button to “on”.disabled: Disables the toggle button.
Event
change: Fires whenever the state of the toggle button is changed:
document.querySelector('vcf-toggle-button').addEventListener('change', e => {
console.log(e.detail.checked);
});
Running demo
-
Fork the
vcf-toggle-buttonrepository and clone it locally. -
Make sure you have npm installed.
-
When in the
vcf-toggle-buttondirectory, runnpm installto install dependencies. -
Run
npm startto open the demo.
Contributing
To contribute to the component, please read the guideline first.
License
Apache 2.0
Sponsored development
Major pieces of development of this add-on has been sponsored by multiple customers of Vaadin. Read more about Expert on Demand at: Support and Pricing