iOS — Liquid Glass JS behaviour

Progress & pull-to-refresh

The activity indicator (iOS’s 12-blade spinner), the hairline progress bar, a ringed percent — and real pull-to-refresh: the spinner rises from behind the edge, stretches, and spins when released.

Documentation

Real scenarios

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

Spinners, bars and rings

The system activity indicator is twelve blades on a staggered fade — every blade fades in place, none of them rotates. Beside it, the 2px hairline bar fills, and the ring animates its percent on arrival.

12 blades, staggered
Hairline 2px bar
۰٪ Ring percent

Pull to refresh, for real

Scroll to the top of the feed and drag down: the spinner rises from behind the edge and stretches as you pull; cross the 80px threshold and let go — it spins for a beat, then collapses and the fresh item flashes in. The button refreshes too, for keyboards.

Nabu Weekly

…

Important props

Important props
Prop Type Default What it does
spinner blades '12' 12 blades with staggered delay; each fades, none rotates.
pull threshold '80px' The release threshold; under it the spring pulls back.
bar height '2px' A hairline 2px progress bar, fully rounded.

Snippet

<span class="ioprg-spinner" role="status" aria-label="در حال بارگذاری">
    <i></i><i></i>…12 blades…
</span>

<style>
.ioprg-spinner { position: relative; display: inline-block; inline-size: 20px; aspect-ratio: 1; }
.ioprg-spinner i { position: absolute; inset: 0; border-radius: 50%;
                   animation: ioprg-fade 1s linear infinite; }
.ioprg-spinner i::before { content: ''; display: block; margin: 1px auto; inline-size: 2px;
                           block-size: 5px; border-radius: 999px; background: #8E8E93; }
.ioprg-spinner i:nth-child(2) { rotate: 30deg; animation-delay: .08s; }
</style>