Pixel UI/Forms/Toggle

Toggle

A pixel switch: a pal walks across to flip it.

<piix-toggle>DOM + canvasForm-ready
Dark mode
Pal
Tone

The knob is a pal standing in the track. Switch it and the pal walks to the other end, turns, and the track lights up behind it.

Installation

<!-- once, anywhere on the page: every component -->
<script src="https://cdn.jsdelivr.net/npm/piixpal@0.6/piixpal.min.js"></script>

Usage

<piix-toggle checked>Dark mode</piix-toggle>

Examples

Settings

Notifications Sound Beta features

API reference

AttributeWhat it doesDefault
checkedon–
palwho flips itbitbug
tonethe colour when onlime
namethe form field name–
valuesent when onon
disabledcan't be flipped–

Events

EventWhen
changewhen it flips
piix:toggledetail.checked

Accessibility