Skip to content
DocsStyle
Style

Motion

Motion is part of the Atmosphere design. Cards settle in, keys travel, toggles spring, the thermostat needle sweeps, charts draw and numbers count up. All of it stops when a user asks for reduced motion.

#What moves

Motion Where How long
Cards settle in Cards rise 14px and fade in, one after another, 55ms apart 700ms
Keys travel A key moves down 4px when pressed and lifts 2px on hover 90ms down, 160ms up
Toggles spring The switch knob overshoots a little and settles 260ms
The needle sweeps The thermostat dial's needle turns to its value 1500ms
Charts draw Lines draw from left to right, bars grow, rings fill 900 to 1600ms
Numbers count Large numbers count up from zero, once 1300ms

The sidebar and other fixed parts of the screen never animate in. Nothing moves when you scroll.

#Motion tokens

All durations and curves are tokens in src/styles/tokens/_motion.css:

Token Value Used for
--am-dur-1 120ms Small color and opacity changes
--am-dur-2 260ms Hover, open and close
--am-dur-3 480ms Small entrances
--am-dur-4 900ms Bars growing, tubes filling
--am-dur-settle 700ms The card entrance
--am-dur-draw 1600ms A line drawing itself
--am-dur-count 1300ms A number counting up
--am-dur-sweep 1500ms The thermostat needle
--am-stagger 55ms The delay between cards
--am-rise 14px How far a card rises from
--am-key-travel 4px How far a key moves when pressed
--am-lift 2px How far a key lifts on hover
--am-ease-out cubic-bezier(.2,.7,.2,1) The default curve
--am-ease-spring cubic-bezier(.34,1.4,.64,1) The toggle's overshoot

To make the whole product calmer, make the durations shorter or set --am-stagger to 0ms.

#Motion components

They are in src/components/motion/.

#Stagger

Makes its children settle in one after another. Put it inside a grid, around the cards:

TSX
import { Stagger } from '@/components/motion/Stagger';

<div className="am-grid">
  <Stagger>
    <Card span={4}>...</Card>
    <Card span={4}>...</Card>
    <Card span={4}>...</Card>
  </Stagger>
</div>;

Stagger adds the class am-settle and a CSS variable --i (the child's position) to each child. CSS does the rest, so there are no timers in JavaScript.

Prop Default What it does
max 15 The highest delay step, so item 60 does not wait three seconds.
offset 0 Start later in the sequence, when another Stagger is above.
as 'am-settle' The animation class to add.

#CountUp

TSX
import { CountUp } from '@/components/motion/CountUp';
import { num } from '@/lib/format';

<CountUp value={1284} />
<CountUp value={21.4} format={(v) => num(v, 1)} />

It counts once, when it first appears. Props: value, format and duration in milliseconds.

#Draw

An SVG <path> that draws itself in. It accepts every <path> prop.

TSX
import { Draw } from '@/components/motion/Draw';

<svg viewBox="0 0 100 40">
  <Draw d="M0 30 L25 18 L50 22 L75 8 L100 12" stroke="var(--am-accent)" fill="none" />
</svg>;

#useReducedMotion

Returns true when the user wants less motion: either their operating system asks for it, or the Motion setting is "Reduced". Use it before you start any animation in JavaScript:

TSX
import { useReducedMotion } from '@/components/motion/useReducedMotion';

const reduced = useReducedMotion();
const duration = reduced ? 0 : 600;

#Animation classes

You can add these classes to any element:

Class What it does
.am-settle The card entrance. Set --i for a delay.
.am-grow A bar grows up from its base.
.am-fill A tube fills from its start.
.am-appear A plain fade in.
.am-draw An SVG path with pathLength="1" draws itself in.

#Reduced motion

People who get dizzy or distracted by motion can turn it off in their operating system. Atmosphere respects that setting, and the Motion switch in the Appearance drawer does the same thing inside the app.

When reduced motion is on:

  • every entrance shows its final state at once,
  • keys no longer move down when pressed,
  • charts appear without drawing, and numbers appear without counting,
  • loading skeletons stop shimmering.

The page is complete on the first frame. Nothing is hidden.