Lightbox

Gestures

View as Markdown

The canonical interaction rules. Every input method gets the behaviour its platform taught you.

Rules

Input Not zoomed Zoomed
Touch swipe ← → Next / previous, native scroll momentum Pan (with inertia and rubber-band edges)
Touch swipe ↑ ↓ Pull to dismiss Pan
Pinch (touch, trackpad) Zoom around the fingers; pinch below fit and release to close Zoom; settles back into 1×–maxZoom
Double tap / double click Zoom to the point (≥ 2×, or enough to fill the screen) Back to fit
Tap image (touch) Toggle data-ui-hidden Toggle data-ui-hidden
Tap / click backdrop Close (closeOnBackdropClick) Close
Mouse drag ← → Next / previous, with momentum (Blossom’s drag engine) Pan
Mouse drag ↑ ↓ Pull to dismiss Pan
Trackpad two-finger swipe ← → Native scroll-snap: the OS’s own physics Pan
Wheel / two-finger scroll ↑ ↓ — (or zoom with wheelToZoom) Pan (or zoom with wheelToZoom)
Ctrl / ⌘ + wheel Zoom around the cursor Zoom around the cursor
← → Previous / next Previous / next
+ − 0 Zoom in / out / reset Zoom in / out / reset
Esc Close Close

Why it feels native