better-motion

Installation
SKILL.md

Motion

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.

Less motion, exact values

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.

How often it is seen decides whether it moves

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.

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.

Installs
1.6K
GitHub Stars
12.6K
First Seen
5 days ago