better-motion
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.
Install
npx skills add https://github.com/jakubkrehel/skills --skill better-motionTransitions
Recipes for interruptible transitions, press feedback, a shared spring, first-render behavior, theme switches and the reduced-motion fallback. Staged entrances and exits live in enter-exit.md [blocked], and icon swaps in icon-transitions.md [blocked].
Interruptible animations
Scale on press
:enabled never matches a link. A button that can render as <a> uses :not(:disabled):active, or not-disabled:active: in Tailwind 4.
Static prop pattern
Where the button has no variant API to carry the opt-out, apply the scale class conditionally on a static prop:
One transition for the surface
MotionConfig sets the default transition for every motion element inside it. A child overrides it only where it differs, as a tab indicator at 0.4 does:
Skip animation on page load
The icon recipe in icon-transitions.md [blocked] shows initial={false} used correctly. It suits icon swaps, toggles, tabs and segmented controls, anything with a default state on page load.
Setting it around a first-time entrance skips that entrance entirely. Check the component on a full page refresh before adding it.
Suppress transitions on theme switch
Inject a stylesheet that turns off every transition, force a style flush so the new colors commit while it applies, then remove it after the next frame:
The new theme resolves while the override is still in the document, so no transition starts. The nested requestAnimationFrame removes the override only after that paint.
That covers the OS-level change. An in-app toggle needs the same steps around its own flip: apply the override, change the theme, flush and remove. next-themes ships this as disableTransitionOnChange.
High-frequency motion
Reduced-motion fallback
The opacity fade runs for everyone, and movement, scale and blur join it only without the preference:
In Tailwind, prefix movement, scale and blur utilities with motion-safe:. In Motion, wrap the app in <MotionConfig reducedMotion="user">. It turns off transform and layout animations under the preference and keeps opacity. Blur still runs there, so branch on useReducedMotion() where a recipe animates filter.