afk
Works through a project while you're away, finding improvements and new ideas, building the best of them on a local branch and…
Decides what should animate and builds it, with exact values for duration, easing, scale and distance and recipes for enters, exits, icon swaps, shared layout animation and drag.
Claude Code
$ npx -y skills add jakubkrehel/skills --skill better-motion --agent claude-code
Codex
$ npx skills add jakubkrehel/skills --skill better-motion -a codex -y
Cursor
$ npx skills add jakubkrehel/skills --skill better-motion -a cursor -y
Gemini CLI
$ npx skills add jakubkrehel/skills --skill better-motion -a gemini-cli -y
GitHub Copilot
$ npx skills add jakubkrehel/skills --skill better-motion -a github-copilot -y
OpenCode
$ npx skills add jakubkrehel/skills --skill better-motion -a opencode -y
Windsurf
$ npx skills add jakubkrehel/skills --skill better-motion -a windsurf -y
name: better-motion description: Decides what should animate and builds it, with exact values for duration, easing, scale and distance and recipes for enters, exits, icon swaps, shared layout animation and drag.
This skill decides whether an element should move and gives the values and recipes for when it should. It covers transitions, springs, enters and exits, icon swaps, shared layout animation, animated height and drag.
The first question is whether to animate at all, and the answer is often no. Add motion where the request asks for it or a principle here calls for it. Removing an animation is a valid fix.
The values come in two kinds. The press scale, the icon cross-fade, the stagger and the spring bounce are exact, so `0.96` is not `0.95`. The duration, scale and distance tables are starting points for desktop web. Adjust them by eye for the element's size and the distance it travels. Full-screen transitions on mobile run longer and travel farther.
Keep the project's motion library, tokens and curves, and match its motion language wherever no principle here gives a value. A deliberate and consistent project convention is a preference and not a finding. That covers a value too, so a project that presses to `0.95` on every button keeps it. The same detail done two ways within the project is a finding.
The reduced-motion requirement, pause controls and the single-pointer alternative to a drag belong to `better-accessibility`. Surfaces, icon weight and color and hover gating belong to `better-ui`. The layout an animation moves between belongs to `better-layout`.
Keystrokes, row hovers and the content behind a tab change instantly, or with a transition of `150ms` or less on `opacity` or `background-color`. A tab's indicator may still travel between tabs. See [transitions.md](transitions.md#high-frequency-motion).
A menu people open many times a day skips its opening animation and animates only as it closes. A context menu and a command menu count, and a menu on a settings page does not. Reserve expressive motion for infrequent moments such as a view's first load, a success state or an empty state.
Every animated state change also leaves a static cue in the form of a color, icon or label. Motion is never the only feedback channel.
Drive interactive state changes with CSS transitions or a motion library's springs, which retarget when the user reverses mid-flight. Keyframes run a fixed timeline and cannot reverse, so reserve them for sequences that run once. See [transitions.md](transitions.md).
Small elements move fast and large ones take longer:
| Element | Enter | | --- | --- | | Tooltips and other small elements | `150ms` | | Dropdowns and menus | `250ms` | | Modals, drawers and panels | `350ms`–`450ms` |
An exit runs shorter than its enter, so a dropdown that opens in `250ms` closes in `150ms`.
Enters, exits and state changes take `ease-out`. Loading indicators and other continuous loops take `linear`. A sheet opening, a shape morphing, a drag settling and a slider thumb take a spring, because they imitate a physical object.
A color or opacity change never takes a spring, since nobody can see the difference. CSS has no practical spring. Without a motion library, stand in with `cubic-bezier(0.2, 0, 0, 1)` at the same duration.
Write a spring as `{ type: "spring", duration: 0.3, bounce: 0 }`, and bounce is always `0`. Use `0.3` for small swaps, `0.4` for a tab indicator and `0.45` for a drawer.
Where one surface shares a spring, set it once on `MotionConfig` and leave `transition` off the children. See [transitions.md](transitions.md#one-transition-for-the-surface).
A tooltip or dropdown enters from `0.96` or `0.97`. A modal or panel enters from `0.98` or `0.99`, because a large surface scaling from `0.95` changes too much of the screen. A modal or panel exits to `0.99`, a smaller change than its enter.
Set `transform-origin` toward the element that opened the popup, never the default center. Base UI and Radix publish that side as a CSS variable. A badge or indicator in a corner scales from that corner. A dialog centered on the screen keeps the center. See [enter-exit.md](enter-exit.md#origin-from-the-trigger).
Travel only far enough to show direction:
| Movement | Distance | | --- | --- | | A text swap | `4px` | | A page transition | `8px` | | Dropdowns, tooltips and most elements | `8px`–`32px` | | Sheets and side panels | Up to `70%` of their own width or height |
A dropdown moves away from its trigger, a panel enters from the side it was opened from and a tab indicator travels between the two tabs.
A pressed button scales to `0.96` over `150ms` with `ease-out`, and a disabled one never scales. Give the button an opt-out where the motion would distract, through the component's existing variant API or a `static` prop. See [recipes for CSS, Tailwind and Motion](transitions.md#scale-on-press).
Where sequence communicates hierarchy in a staged entrance, split the content into semantic chunks such as title, description and actions. Stagger them `100ms` apart, each entering with opacity, `4px` of blur and `12px` of `translateY` over `300ms` with `ease-out`. Never stagger routine interactions. See [enter-exit.md](enter-exit.md).
Exit with opacity, `4px` of blur and a fixed `-12px` `translateY` over `150ms` with `ease-out`, never the full container height. Slide fully out only where the destination carries meaning, such as a drawer closing. Remove the element instantly where motion adds no informati
Works through a project while you're away, finding improvements and new ideas, building the best of them on a local branch and…
Reviews and fixes keyboard and focus behavior, ARIA, accessible names, forms, screen-reader announcements, motion and zoom…
Builds and checks color systems by generating palettes, naming semantic tokens, converting between formats and measuring contrast.
Reviews a screen, flow or whole interface across accessibility, layout, writing, typography, color, UI polish and motion, and…
Sets grouping, alignment, reading order, responsive structure and room for translated text, so a layout holds up when it is…
Sets and reviews how text renders, from the type scale and spacing to font features, wrapping, truncation and punctuation.
Design banners for social media, ads, website heroes, creative assets, and print. Multiple art direction options with optional…
Use to design, redesign, critique, audit, polish or animate a frontend: websites, landing pages, dashboards, app UI, components,…
Hyperframes-based video template for retro pixel deck motion design. Use when users want a high-fidelity, multi-scene…
Create branded architecture, architecture delta, IT current-state, flowchart, sequence, state machine, ER/data model, timeline,…