lion/packages/switch/README.md
2019-11-13 11:00:48 +01:00

29 lines
564 B
Markdown

# Switch
[//]: # 'AUTO INSERT HEADER PREPUBLISH'
`lion-switch` is a component that is used to toggle a property or feature on or off.
## Features
- Get or set the checked state (boolean) - `checked` boolean attribute
- Pre-select an option by setting the `checked` boolean attribute
- Get or set the value of the choice - `choiceValue()`
## How to use
### Installation
```sh
npm i --save @lion/switch
```
```js
import '@lion/swith/lion-switch.js';
```
### Example
```html
<lion-switch name="airplaneMode" label="Airplane mode" checked></lion-switch>
```