Skip to the page
Tactile UI

Liquid switch

The settings switch whose thumb is a drop of glass. It is the kit’s switch. Held, the thumb is exactly where the finger is; let go and it carries on at the finger’s speed and settles without bounce. It stretches as it travels, and on a quick move it leaves a small drop behind that it takes back in. The glass bends a painted copy of the switch’s own track, so the slot’s colour shows through the thumb.

On this page
  1. Anatomy
  2. Variants
  3. States
  4. Props and options
  5. Usage notes
  6. Accessibility
  7. Related parts

Anatomy

The thumb is a pill of glass drawn by one shader: a dome whose rim bends a painted copy of the switch’s own track, lit from above left, with a soft shadow. If the glass cannot be drawn, the kit’s own grip is kept and frosted.

Variants

  • On
  • Off
  • No sentence under the title
  • Disabled, on
  • Frosted fallback

States

  • Off
  • On
  • Disabled off
  • Disabled on
  • Frosted on

Props and options

NameKindDescription
changeeventThe checkbox’s own change event.
data-liquidattributeWhich thumb is showing. Read it, do not write it: the script falls back to frosted when WebGL2 is missing, the context is lost or reduced transparency is set.
liquidSwitchHTML(options)functionThe switch as markup: id, name, value, checked, disabled, label or labelledby.
liquidSwitchStats()functionWhat is drawing: WebGL contexts open (0 or 1 for the whole page), switches on the page, and how many of them are glass.

Usage notes

Drag a thumb and let go, or tap the row. Tab to a switch and press Space. Without WebGL, or with reduced transparency set, the thumb is frosted instead of glass and everything else is the same.

Accessibility

  • Keyboard: Tab reaches the switch and Space turns it; the thumb springs to its end as it does for a finger. A disabled switch is out of the tab order.
  • The state is never the glass: the slot lights as the kit’s switch does and the thumb sits at that end.
  • Frosted fallback. It still follows the finger and springs.

Switch

On or off, applied the moment it moves. A native checkbox with a ridged thumb in a slot that lights green when on.

Ferro switch

The switch on a settings row whose grip turns to ferrofluid when a hand comes near. At rest it is the kit’s switch. Bring the pointer within a finger’s width or two and the grip becomes a glossy black drop; closer, its spikes snap up and lean toward the pointer. Turn it on and the drop surges across the slot, spikes down while it travels, and stands them taller on the lit side. Move away and they melt and the plain grip comes back. A keyboard focus wakes it too.

Liquid segmented control

The segmented control whose selection is one bead of glass. It is the kit’s control: the same tray, native radios and labels. Held, the bead is where the finger is; let go and it settles on the nearest segment without bounce. It stretches behind its head, and a long quick move leaves a drop that it takes back in. The bead is as wide as the segment it is over, so segments of unequal width work.

Settings row

What a settings page is made of: a label, one sentence under it and the control at the end, ruled like the list with a hairline between rows and nothing else drawn. A row with a switch or a check is one label, so pressing anywhere on it turns the control; a row with a key, a select or a value is a plain box, so a press means what the key says.