Vaadin Component Factory Toggle Button
npm install @vaadin-component-factory/vcf-toggle-buttonvcf-toggle-button:
sh
npm i @vaadin-component-factory/vcf-toggle-button --save
`
Usage
Once installed, import it in your application:
`js
import '@vaadin-component-factory/vcf-toggle-button';
`
And use it:
`html
`
$3
- label: Provide a label for the toggle button.
- checked: Changes the state of toggle button to "on".
- disabled: Disables the toggle button.
$3
- change: Fires whenever the state of the toggle button is changed:
`javascript
document.querySelector('vcf-toggle-button').addEventListener('change', e => {
console.log(e.detail.checked);
});
`
Running demo
1. Fork the vcf-toggle-button repository and clone it locally.
1. Make sure you have npm installed.
1. When in the vcf-toggle-button directory, run npm install to install dependencies.
1. Run npm start` to open the demo.