Apple interface patterns
Use when building gesture-driven UI on the web — drag, swipe, sheets, drawers, momentum, velocity handoff, interruptible transitions — or when an interaction feels laggy, snappy in the wrong way, or breaks when the user changes their mind mid-motion. Also use for translucent materials and depth, size-specific typography, and the design foundations behind Apple-style interfaces.From its SKILL.md
npx -y skills add m-de-graaff/skills --skill apple-interface-patternsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
11.7 KB, as published. Nobody here has run it
Apple Interface Patterns
Apple's approach to fluid, physical interfaces, translated to the web. Chiefly from Designing Fluid Interfaces (WWDC 2018), plus the typography and design-principles talks.
Core principle: an interface feels alive when motion starts from the current on-screen value, inherits the user's velocity, projects momentum forward, and can be grabbed and reversed at any instant. Springs are the tool that makes all of that natural, because they are inherently interruptible and velocity-aware.
Baseline curves, durations, and the frequency gate are in animation-principles. This skill is
the gesture-physics and materials layer on top.
1. Response — kill latency
The moment lag appears, the feeling of directness falls off a cliff.
- Respond on pointer-down, not on release. Waiting for
clickto show feedback feels dead. - Audit every latency on the input path — debounces, artificial timers, transition waits.
- Feedback must be continuous during the interaction, not only at the end. A drag, slider, or drawer updates 1:1 with the pointer the whole way.
2. Direct manipulation — 1:1 tracking
"Touch and content should move together."
The element stays glued to the finger, and respects the offset from where it was grabbed. Snapping to the element's centre on grab breaks the illusion instantly.
el.addEventListener("pointerdown", e => {
el.setPointerCapture(e.pointerId);
const grabOffset = e.clientY - el.getBoundingClientRect().top;
// track position + timestamp history — you need velocity at release
});
Track a short history of recent pointermove events, not just the current point.
3. Interruptibility
"The thought and the gesture happen in parallel."
The single most important principle here. A closing sheet the user grabs again must follow the finger — not finish closing, then reopen.
- Never lock out input during a transition.
- Animate from the presentation value, not the target. On interrupt, read the element's live on-screen transform and start from there. Starting from the logical value causes a visible jump.
- Avoid CSS transitions and keyframes for gesture-driven motion — they can't be grabbed and reversed cleanly mid-flight.
- Blend velocity on reversal. Replacing one animation with another at a reversal creates a velocity discontinuity that reads as a brick wall. Use a spring that re-targets from the current velocity.
- Decompose 2D motion into independent X and Y springs. One spring over a 2D distance desyncs when the axes have different velocities.
4. Spring parameters
Apple replaced the physics triplet with two designer-facing parameters. Think in these:
- Damping ratio — overshoot.
1.0is critically damped, no bounce. Below1.0oscillates. - Response — how quickly it reaches the target, in seconds. Not a duration — a spring has no fixed duration; settle time emerges from the parameters.
| Interaction | Damping | Response |
|---|---|---|
| Move / reposition | 1.0 | 0.4 |
| Rotation | 0.8 | 0.4 |
| Drawer / sheet | 0.8 | 0.3 |
Default to damping 1.0. Add bounce (~0.8) only when the gesture itself carried
momentum — a flick, a throw, a drag release. Overshoot on a menu that merely faded in feels
wrong; overshoot on a card you flicked feels right.
Motion's bounce + duration API maps closely onto damping + response.
5. Velocity handoff
When the gesture ends, the animation continues at the finger's exact velocity. This is the detail that most separates fluid from merely fine — without it there is a visible seam where dragging stops and animating starts.
Pass the release velocity as the spring's initial velocity. If the API wants it relative, normalise by the remaining distance:
relativeVelocity = gestureVelocity / (target − current)
Motion takes absolute px/s directly via velocity.
6. Momentum projection
"Take a small input and make a big output."
Don't snap to the boundary nearest the release point. Project where the gesture was going, then snap to the target nearest that. This is what makes a flick feel like a throw.
// Apple's projection from the Designing Fluid Interfaces sample code
function project(initialVelocity /* px/s */, decelerationRate = 0.998) {
return (initialVelocity / 1000) * decelerationRate / (1 - decelerationRate);
}
const projected = currentPosition + project(releaseVelocity);
animateSpringTo(nearestSnapPoint(projected), { velocity: releaseVelocity });
The textbook v²/(2·decel) is not what Apple ships — use the exponential-decay form above.
It's what good bottom sheets and carousels (Vaul, Embla) do.
7. Spatial consistency
- Enter and exit along the same path. A panel that slides in from the right dismisses to the right. In-from-right, out-the-bottom reads as disconnected.
- Anchor to the source — a menu or sheet originates from the element that triggered it.
- Mirror the easing on reversible transitions, using inverse control points for the return.
8. Hint in the direction of travel
Humans predict the final state from a trajectory. Intermediate motion should telegraph the outcome — Control Center modules grow up and out toward the finger — rather than interpolating blindly toward it.
9. Rubber-banding
Resist progressively at an edge instead of stopping hard. A hard stop reads as frozen; continuous resistance reads as responsive-but-empty.
function rubberband(overshoot, dimension, constant = 0.55) {
return (overshoot * dimension * constant) / (dimension + constant * Math.abs(overshoot));
}
10. Gesture details
- Tap — highlight on touch-down, commit on touch-up. Around 10px of hit padding, and allow cancel-by-dragging-away-and-back.
- Drag — a ~10px movement threshold before committing to a direction, then track 1:1.
- Detect all plausible gestures in parallel from the first move, then cancel the losers once intent is clear. Recognisers that only report a final state throw away the continuous tracking you need for feedback.
- Minimise disambiguation delays — double-tap detection unavoidably delays single taps, so only pay it where double-tap genuinely exists.
11. Materials and depth
Translucency is a floating functional layer that brings structure without stealing focus. On the
web, backdrop-filter.
- Build chrome as translucent layers with content scrolling underneath, not opaque bars consuming a fixed strip.
- Weight encodes hierarchy — heavier materials separate structural regions, lighter ones draw attention to controls. Never stack a light translucent surface on another; legibility collapses.
- Bigger surfaces read as thicker — stronger blur, deeper shadow than small chips.
- Dim to focus, separate to keep flow. A modal pairs its surface with a scrim and pushes the background back. A non-blocking side panel uses translucency and offset without a scrim.
- Vibrancy keeps text legible over changing backgrounds — higher contrast, slightly heavier weight, a small tracking bump. Put colour on a solid layer, not the translucent foreground.
- Scroll edge effects, not hard dividers — fade a small gradient mask where content meets floating chrome, only where they actually overlap.
- Materialise, don't fade — animate blur radius and scale together so the surface arrives as a material rather than an opacity ramp.
.toolbar {
background: rgb(255 255 255 / 0.6);
backdrop-filter: blur(20px) saturate(180%);
border-top: 1px solid rgb(255 255 255 / 0.4); /* light catching the material's edge */
}
12. Multimodal feedback
Causality — trigger on the actual causal event, and match the feedback's character to the action. Harmony — visual, sound, and haptic fire on the same frame; latency between them destroys the illusion. Utility — reserve haptics and sound for meaningful moments. Over- feedback trains people to ignore all of it.
13. Accessibility beyond reduced motion
Three independent signals, all worth honouring:
prefers-reduced-motion: reduce— cross-fades instead of slides and springs; drop overshoot; keep opacity and colour that aid comprehension.prefers-reduced-transparency: reduce— raise background opacity, drop the blur.prefers-contrast: more— near-solid backgrounds with a defined border.
Also avoid full-viewport moving backgrounds, slow looping oscillations near one cycle per five seconds, and abrupt brightness jumps. Make large moving objects semi-transparent while they travel.
14. Typography
- Tracking is size-specific — never one value for all sizes. Large display text wants
negative tracking; small text wants slightly positive. A fixed
letter-spacingis wrong somewhere. - Leading tracks size inversely — tight on large headings, looser on body.
- Build hierarchy from weight, size, and leading as a set, not size alone. Weight adds presence without taking space.
- Respect the user's text-size setting. Space in
rem/emso larger text doesn't break the layout. - Default to the system font — it already ships optical sizing and tracking tables. Override with a reason.
.display {
font-size: clamp(2rem, 5vw, 4rem);
line-height: 1.05;
letter-spacing: -0.02em;
font-optical-sizing: auto;
}
15. Design foundations
The eight principles the craft above serves — useful mostly as the names to reason with: purpose (decide what not to build), agency (choices plus easy undo; confirmations only for the irreversible), responsibility (privacy and anticipated misuse), familiarity (consistent things behave consistently; break a pattern only with proof), flexibility (contexts, devices, abilities), simplicity (not minimalism — burying everything in one place looks minimal and isn't simple), craft (every spacing and timing value defensible), and delight (the result of the other seven, not confetti on top).
Tactically: feedback comes in four kinds — status, completion, warning, error. Every screen
answers where am I, where can I go, what's there, how do I get out. Proximity implies
relationship, so put a control near what it affects — if you need a label to explain a control,
the mapping is weak. Name things for their contents (Library, Progress), not vague
umbrellas (Home).
Quick reference
| Need | Value |
|---|---|
| Default UI spring | damping 1.0, response 0.3–0.4 |
| Momentum spring | damping ~0.8, response 0.3–0.4 |
| Gesture → spring velocity | gestureVelocity / (target − current) if normalised |
| Flick landing point | current + (v/1000)·d/(1−d), d ≈ 0.998 |
| Interrupt cleanly | start from the live on-screen value |
| 1:1 drag | Pointer Events + capture, respect the grab offset |
| Boundary | rubber-band, never a hard stop |
| Type tracking | size-specific; -0.02em large, near 0 body |
Non-goals
Doesn't replace the baseline motion rules (animation-principles). Doesn't cover static polish
(make-interfaces-feel-better) or React specifics (react-patterns). Doesn't reproduce Apple's
visual design — these are behaviours, not a skin.
Source
Adapted from ECC by Affaan Mohamed (MIT).