Toggle
Alternate appearance for a toggle that simulates on/off instead of checked/unchecked.
Import
js
import { MpToggle } from '@mekari/pixel3'
Playground
API
MpToggle
Props
Events
Slots
Name | Type | Default |
---|---|---|
id | string | - |
name | string | - |
value | string | - |
is-checked | boolean | false |
is-disabled | boolean | false |
is-invalid | boolean | false |
is-read-only | boolean | false |
Usage
With Description
Accessibility
WAI-ARIA: https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/
- Provide aria-label and or aria-labelledby for screen reader support.
- When checked, checkbox has aria-checked set to true.
- When not checked, checkbox has aria-checked set to false.
- When partially checked, checkbox has aria-checked set to mixed.