Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vaadin-component-factory/vcf-toggle-button
Vaadin Component Factory Toggle Button.
https://github.com/vaadin-component-factory/vcf-toggle-button
polymer3 switch toggle toggle-button toggle-switch vaadin webcomponent
Last synced: 3 months ago
JSON representation
Vaadin Component Factory Toggle Button.
- Host: GitHub
- URL: https://github.com/vaadin-component-factory/vcf-toggle-button
- Owner: vaadin-component-factory
- License: apache-2.0
- Created: 2019-07-08T07:43:29.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-05T18:15:24.000Z (over 1 year ago)
- Last Synced: 2024-10-01T03:03:15.661Z (3 months ago)
- Topics: polymer3, switch, toggle, toggle-button, toggle-switch, vaadin, webcomponent
- Language: JavaScript
- Homepage: https://vcf-toggle-button.netlify.com/
- Size: 29.3 KB
- Stars: 1
- Watchers: 9
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# <vcf-toggle-button>
## Demo
https://vcf-toggle-button.netlify.com/
## Installation
Install `vcf-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
```
### 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:
```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](https://www.npmjs.com/) installed.
1. When in the `vcf-toggle-button` directory, run `npm install` to install dependencies.
1. Run `npm start` to open the demo.
## Contributing
To contribute to the component, please read [the guideline](https://github.com/vaadin/vaadin-core/blob/master/CONTRIBUTING.md) first.
## License
Apache License 2.0