Slide Toggle

A sliding toggle element that can capture input from a user.

javascript
import { SlideToggle } from '@brainandbones/skeleton';

Examples

Accent Colors

Sizes

Labeled

Disabled

Usage

typescript
let myValue: boolean = false;
html
<SlideToggle bind:checked={myValue}>(label)</SlideToggle>
html
<SlideToggle bind:checked={myValue} size="lg" />
html
<SlideToggle bind:checked={myValue} disabled />

Properties

This component makes use of $$restProps, which allows arbitrary attributes to be provided to the component.

Prop Type Default Values Description
checkedbooleanfalsetrue | falseThe checked state of the input element.
accentstringbg-accent-500classProvide classes to set the checked state color.
sizestringmdsm | md | lgSets the size of the component.

Accessibility

ARIA Guidelines
Prop Required Description
label-Provide a semantic label.

Keyboard Interactions

Keys Description
Space or EnterWhen focus is on the slide toggle, changes the state of the slide toggle.