iOS — Liquid Glass JS behaviour

Classic controls

iOS switch, slider, stepper, segmented control and page control with real physics: the switch springs, the slider thickens while dragged and the segment glides its glyph on a spring.

Documentation

Real scenarios

The component as it is used in a product — not a specimen grid.

Classic controls, real physics

A settings stack with the official iOS controls: flip a switch to feel the spring, drag the slider and watch the 4px rail fatten to 10px under your finger, tap a segment to see the thumb glide beneath the glyph, and swipe the album row — the page-control dots follow.

Wi-Fi NabuXUI-5G
Notifications
Focus mode

Volume

Output level ۶۰٪
Guests ۲

Listening time

Recent albums

Istanbul Alleys
Bachar Choir · 2025
Rainy Night
Anna & Omar · 2024
Southern Sea
Bandari Nights · 2023

Important props

Important props
Prop Type Default What it does
switch size '51 × 31' The official UISwitch size; on-tint #34C759, dark #30D158.
slider track '4 → 10px' The track fattens from 4 to 10px under the finger.
segmented behaviour 'sliding thumb' The selection thumb slides beneath the glyph, iOS 26 style.

Snippet

<label class="ioctl-switch">
    <input type="checkbox" checked>
    <span class="ioctl-knob"></span>
</label>

<style>
.ioctl-switch { position: relative; inline-size: 51px; block-size: 31px;
                border-radius: 999px; background: #7878802e; transition: background .25s; }
.ioctl-switch input:checked + .ioctl-knob { translate: 20px 0; }
.ioctl-switch:has(input:checked) { background: #34C759; }
.ioctl-knob { position: absolute; inset-block-start: 2px; inset-inline-start: 2px;
              inline-size: 27px; aspect-ratio: 1; border-radius: 50%; background: #fff;
              box-shadow: 0 3px 8px #00000024, 0 3px 1px #0000000f;
              transition: translate .25s cubic-bezier(.3,.9,.4,1.1); }
</style>