@materialr/switch
v2.0.3
Published
Material switch implementation for React
Downloads
26
Readme
MaterialR Switch
@materialr/switch
React Material switch implementation
Installation
$ npm install --save @materialr/switchDemo
A full demo is available on the MaterialR website showcasing all variants.
Components
Default export
import Switch from '@materialr/switch';Props
| Prop | Type | Required | Default | Description |
| ------------- | ------ | -------- | ---------- | ---------------------------------- |
| checked | bool | No | false | Whether the switch is on |
| className | string | No | undefined | Additional classNames to add |
| disabled | bool | No | false | Whether the switch is disabled |
| id | string | No | uuidv1() | The id attribute of the element |
| label | string | Yes | N/A | The label to render for the switch |
| name | string | No | undefined | The element's name attribute |
| onBlur | func | No | undefined | The blur event handler |
| onChange | func | No | undefined | The change event handler |
| onDragStart | func | No | undefined | The dragstart event handler |
| onDrop | func | No | undefined | The drop event handler |
| onFocus | func | No | undefined | The focus event handler |
