Motion
M3 Expressive motion uses springs instead of duration-and-easing pairs. Two schemes, two spring families and three speeds cover every component, and they follow the active data-motion setting automatically.
Try it
The box below springs with the fast spatial spring. In the expressive scheme it overshoots; switch the top-bar motion toggle to standard and the overshoot disappears. With prefers-reduced-motion set, it moves to its new place at once, as every component's spatial motion does.
Schemes, families & speeds
- Schemes —
expressive(visible overshoot, the default) andstandard(restrained). Set viadata-motion,ThemeProviderorThemeScope. - Families —
spatial(position, size, shape — may overshoot) andeffects(colour, opacity — never overshoot, critically damped). - Speeds —
fast,defaultandslow.
Spring tokens
Compose springs, given as damping ratio / stiffness (mass 1). Motion’s damping coefficient is derived as 2 · dampingRatio · √stiffness.
| Scheme | Family | fast | default | slow |
|---|---|---|---|---|
| expressive | spatial | 0.6 / 800 | 0.8 / 380 | 0.8 / 200 |
| standard | spatial | 0.9 / 1400 | 0.9 / 700 | 0.9 / 300 |
| both | effects | 1 / 3800 | 1 / 1600 | 1 / 800 |
Effects springs are shared by both schemes. Expressive spatial overshoots about 9% (fast) and 1.5% (default/slow); standard spatial shows no visible overshoot; effects never overshoot.
Using springs
In JS, useM3Spring(family, speed) returns a Motion spring for the active scheme (read from useThemeScope); getM3Spring(scheme, family, speed) takes an explicit scheme. Speed defaults to default. A transition that continues a gesture (a sheet released mid-drag) starts with the gesture's speed: springWithVelocityToLinearEasing from @windmorph/react/primitives gives that spring as a CSS linear() easing and its settle duration.
import { useM3Spring } from '@windmorph/react';
import { motion } from 'motion/react';
function Expander() {
// Spring for the active scheme (expressive by default), read from ThemeScope.
const spring = useM3Spring('spatial', 'fast');
return <motion.div animate={{ scale: 1 }} transition={spring} />;
}
// Scheme-independent: getM3Spring('standard', 'effects', 'default').In CSS, the --md-sys-motion-spring-* variables and the generated ease-m3-<family>-<speed> / duration-m3-<family>-<speed> utilities switch with data-motion.
/* Utilities read --md-sys-motion-* variables, which switch with data-motion. */
.card {
transition-timing-function: var(--md-sys-motion-spring-spatial-default-easing);
}
/* Tailwind utilities (generated): ease-m3-<family>-<speed> and duration-m3-<family>-<speed>. */
<div className="transition-transform ease-m3-spatial-fast duration-m3-spatial-fast" />Reduced motion
When prefers-reduced-motion is set, the components remove movement that isn't essential, following WCAG 2.3.3 (Animation from Interactions). Slides, size and shape changes, morphs, rotations and travelling indicators happen at once; a surface that enters or leaves fades instead. State changes stay visible: colours and opacity still fade on the effects springs.
Essential motion keeps working: indeterminate progress and loading indicators, which show that something is happening, and anything that follows a finger, the pointer or the scroll position directly (a drag, a pull to refresh, an app bar collapsing with the page). Nothing springs or overshoots after it.
In CSS this needs no code of your own: under reduced motion every --md-sys-motion-spring-spatial-*-duration is 0ms, so anything on the spatial springs (and the duration-m3-spatial-* utilities) changes at once, while the effects springs keep their durations. A transition list that drops to opacity under reduced motion should give the fade an effects duration of its own. In script, useM3Spring still returns the standard spring, so check Motion's useReducedMotion and skip the movement yourself, as the demo above does.
Content that opens and folds (a list's nested items, Pro's Accordion and Collapse) only fades: a lone fold fades out where it is, then goes. When one item opens as another folds, the folding one goes at once and the opening one appears at full height and fades in, so the content below moves once, or not at all when both are the same height.
Legacy tokens
For consumers migrating from baseline M3, legacy durations (short-1 = 50ms to long-4 = 600ms in 50ms steps, then extra-long-1 = 700ms to extra-long-4 = 1000ms in 100ms steps) and the legacy easing curves are kept:
| Easing | Curve |
|---|---|
emphasized | cubic-bezier(0.2, 0, 0, 1) |
emphasized-accelerate | cubic-bezier(0.3, 0, 0.8, 0.15) |
emphasized-decelerate | cubic-bezier(0.05, 0.7, 0.1, 1) |
standard | cubic-bezier(0.2, 0, 0, 1) |
standard-accelerate | cubic-bezier(0.3, 0, 1, 1) |
standard-decelerate | cubic-bezier(0, 0, 0, 1) |
legacy | cubic-bezier(0.4, 0, 0.2, 1) |
legacy-accelerate | cubic-bezier(0.4, 0, 1, 1) |
legacy-decelerate | cubic-bezier(0, 0, 0.2, 1) |
linear | cubic-bezier(0, 0, 1, 1) |