We the Curious Toggle
An accessible toggle button component
Install
npm i @wethecurious/wtc-ui-library
Usage
Import it into your project
import { Toggle } from '@wethecurious/wtc-ui-library'
Toggle
// label for screen reader
<label id='a-toggle'>Toggle button: </label>
<Toggle
labelId='a-toggle'
isOn={isToggleChecked}
handleToggle={handleToggle}
/>
Props
Prop | Description | Default |
---|---|---|
size | Sets the size of the toggle | |
inOn | Specifies toggle on/off | |
handleToggle | Callback triggere on toggle click | |
labelId | Id of the toggle label for aria-labelledby |