Skip to content
Skills Library
Design & UX · Building & coding

ui-motion-patterns

/ui-motion-patterns

Motion tokens, spring presets, and React/Next.js (motion/react) interaction patterns for product UI that appears in a video — rebuilding real product screens faithfully, animating them as seekable scenes, and keeping the live product's motion consistent with the film. Use when a motion video shows or recreates product UI; for web UI work with no video deliverable use design-expert instead.

Licence
MIT
Last repository change
16.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 16.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Motion tokens, spring presets, and React/Next.js (motion/react) interaction patterns for product UI that appears in a video — rebuilding real product screens faithfully, animating them as seekable scenes, and keeping the live product's motion consistent with the film. Use when a motion video shows or recreates product UI; for web UI work with no video deliverable use design-expert instead.

Original author description

Motion tokens, spring presets, and React/Next.js (motion/react) interaction patterns for product UI that appears in a video — rebuilding real product screens faithfully, animating them as seekable scenes, and keeping the live product's motion consistent with the film. Use when a motion video shows or recreates product UI; for web UI work with no video deliverable use design-expert instead.

How it works

  1. 1. Tokens first
  2. 2. Accessibility and SSR
  3. 3. Patterns and their rules
  4. 4. Rebuilding product UI for video
Original SKILL.md headings · 91 lines, 661 words
SKILL.md preview
---
name: ui-motion-patterns
description: Motion tokens, spring presets, and React/Next.js (motion/react) interaction patterns for product UI that appears in a video — rebuilding real product screens faithfully, animating them as seekable scenes, and keeping the live product's motion consistent with the film. Use when a motion video shows or recreates product UI; for web UI work with no video deliverable use design-expert instead.
---

# UI Motion Patterns

Two jobs: animate real product UI on the web, and rebuild product UI for video without redesigning
it. Both use the same tokens.

## 1. Tokens first

Define motion once and import it everywhere. No inline numbers in components.

```ts
// lib/motion-tokens.ts
export const motionTokens = {
  duration: { instant: 0.1, fast: 0.18, normal: 0.3, slow: 0.5, scene: 0.7 },
  easing: {
    standard: [0.2, 0, 0, 1],   // enter + move
    exit: [0.4, 0, 1, 1],       // leave
    emphasized: [0.3, 0, 0, 1],
  },
  distance: { nudge: 4, small: 8, medium: 16, large: 32 },
  stagger: 0.06,                // keep between 0.05 and 0.10
} as const;

export const springs = {
  press:   { type: "spring", stiffness: 600, damping: 38 },  // buttons, toggles
  snappy:  { type: "spring", stiffness: 420, damping: 34 },  // chips, menus
  gentle:  { type: "spring", stiffness: 260, damping: 27 },  // cards, panels
  layout:  { type: "spring", stiffness: 320, damping: 30 },  // reorder, resize
  camera:  { type: "spring", stiffness: 140, damping: 20 },  // big moves, video only
} as const;
```

With mass 1, damping ratio ζ = damping / (2·√stiffness): press 0.78, snappy 0.83, gentle 0.84,
layout 0.84, camera 0.85 — all inside the 0.75–0.90 band (overshoot ≤ ~6 %). Adjust per brand with
that formula, and keep this table the single source.

## 2. Accessibility and SSR

```tsx
"use client";
import { useReducedMotion } from "motion/react";

export function useSafeMotion() {
  const reduce = useReducedMotion();
  return {
    reduce,
    // reduced motion: drop transforms, keep short opacity changes (≤0.2 s)
    enter: reduce ? { opacity: 1 } : { opacity: 1, y: 0 },
    initial: reduce ? { opacity: 0 } : { opacity: 0, y: 8 },
    transition: reduce ? { duration: 0.2 } : undefined,
  };
}
```

- Use `initial={false}` for elements already visible on first paint to avoid hydration flashes.
- Animate `transform` and `opacity` only. Never animate `width`, `height`, `top`, `left`, or
  `box-shadow` in loops; use `layout` or scale instead.
- Low-end devices: shorten durations and skip decorative motion.

## 3. Patterns and their rules

| Pattern | Rule |
|---|---|
| Button press | `whileTap={{ scale: 0.96 }}` with `springs.press`; feedback within 100 ms |
| Conditional render | wrap in `AnimatePresence` with a stable `key`; every `initial` + `animate` gets an `exit` |
| Page / route transition | `AnimatePresence mode="wait"`: exit completes before enter |
| List stagger | `staggerChildren` 0.05–0.10 s; cap staggered items at ~8, the rest appear together |
| Reorder / resize | `layout` on small subtrees only (≲5 children); otherwise explicit `x`/`y` |
| Modal / sheet | focus trap, Escape closes, scroll lock, `role="dialog"`, `aria-modal="true"`, return focus |
| Toast | enters from the edge it lives on; auto-dismiss pauses on hover/focus |
| Number change | vertical roll: old value exits up with blur, new enters from below; `font-variant-numeric: tabular-nums` |
| Scroll reveal | `whileInView` with `viewport={{ once: true }}`; never re-animate on scroll-out |
| Loading → success | button compresses → spinner → check; keep the button's width stable |

## 4. Rebuilding product UI for video

- **Measure, do not guess.** Take tokens from the product source or computed styles: colors, radii,
  font family/weights/tracking, spacing, icon set and stroke. Sample colors from real screenshots
  and compare.
- **Hybrid default.** Real screenshot as context; rebuild only the elements that animate, pixel-aligned
  over it.
- **Never redesign** without explicit approval. No new colors, fonts, icons, or copy.
- **Capture clean.** Logged out or demo account, fictional data, no PII, no third-party brands
  unless the user owns them.
- **Seekable.** In video, drive every animated value from absolute time (`value = f(t)`), not from
  `motion/react` runtime state. Use `motion/react` for the live web, closed-form springs or GSAP
  timelines for rendered video.

When these patterns are used on a website rather than a video, run the `design-expert` verification
gate (keyboard, focus, reduced motion, performance) before shipping.

Versions

The database has no other skills named ui-motion-patterns.

Database snapshot: 13.11.2026 · package version d6917cce32ce (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 95motion-ui
    Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.
  • 100motion-foundations
    Motion tokens, spring presets, performance rules, device adaptation, accessibility enforcement, and SSR safety for React / Next.js using motion/react. Foundation layer — all other motion skills depend on this. Use when setting up motion tokens, spring presets, reduced-motion…
  • 95motion-ui
    Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.
  • 100motion-foundations
    Motion tokens, spring presets, performance rules, device adaptation, accessibility enforcement, and SSR safety for React / Next.js using motion/react. Foundation layer — all other motion skills depend on this. Use when setting up motion tokens, spring presets, reduced-motion…
  • 91motion-ui
    适用于 React/Next.js 的生产就绪 UI 动效系统。实现动画、过渡或动效模式时使用。
  • 100mobile-motion-patterns
    Motion design rules for the Agenta mobile app (web/mobile) — the shared presets in src/lib/motion, when to animate, and reduced-motion requirements. Use when adding any animation or transition under web/mobile, animating navigation, sheets, skeletons, or list/chat surfaces.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.