Pixel UI/Forms/Liquid toggle

Liquid toggle

A switch whose knob is a drop of liquid metal.

<piix-liquid-toggle>WebGLForm-readyNew
Look

Flip it and the drop stretches across the track with a tail of liquid trailing behind, then snaps back into a bead as the track darkens. A real switch for forms.

Installation

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

Usage

<piix-liquid-toggle label="Dark mode"></piix-liquid-toggle>

Examples

In a form

API reference

AttributeWhat it doesDefault
checkedon–
nameform field name (sends on)–
labelaccessible nameToggle
lookchrome ink water honey: the liquid's materialchrome
colorsyour own material, three colours: floor, horizon, sky (overrides look)–

Events

EventWhen
changewhen it flips

Accessibility