@meveo-org/mv-toggle
v1.0.1
Published
MvToggle is a Meveo component (based on lit-element) that renders a toggle input.
Downloads
8
Keywords
Readme
mv-toggle
MvToggle is a Meveo component (based on lit-element) that renders a toggle input.
Quick Start
To experiment with the MvToggle component.
- Clone this repo.
- Serve the project from the root directory with some http server (best served with meveo itself)
- Sample toggle usage is included in the
demo.js
Includes 4 predefined sizes:
large, medium, small, tiny
default value: large
Sample usage
<mv-toggle
.value="${{ isChecked: !this.checked }}" // value to be passed into click-toggle event
.checked="${this.checked}" // boolean value to set whether toggle is on or off
.disabled="${this.disabled}" // boolean value to set whether the toggle is disabled or not
@click-toggle="${this.handleClickToggle}" // custom event dispatched when the toggle is clicked
.label="${this.label}" // the label shown beside the toggle button
size="large" // the size of the toggle button
></mv-toggle>
You can also check this demo