Motion & focus
One curve, short durations, one focus ring.
Motion explains a change; it never decorates. All values come from one token scale (transitions.dev), imported once in src/styles/motion.css. Pick a token by what the motion does, never by the nearest number. Animate transform, opacity and filter only; never “transition: all”.
Durations
Click a row to play it. Closes are faster than opens.
--duration-stagger--duration-micro--duration-quick--duration-fast--duration-medium--duration-slow--duration-very-slowEasings
Each row plays 500 ms so the curve is easy to see.
--ease-smooth-out--ease-in-out--ease-out--ease-linear--ease-bounceScale, distance, blur
The “pre” state a surface animates from; it always settles to rest. Bigger surfaces start further away.
--scale-large · 0.96
--scale-medium · 0.97
--distance-micro · 4px
--distance-medium · 12px
--blur-small · 2px
--blur-medium · 3px
Which component uses which recipe
| Component | Recipe | Values |
|---|---|---|
| Dialog | 06 modal | open 250 · close 150 · scale .96 · backdrop fade |
| Sheet | 07 panel reveal | open 400 · close 350 · slide from the right + 2px cross-blur |
| DropdownMenu, Select list, DateField popup | 05 menu dropdown | open 250 · close 150 · grows from the trigger (origin-aware) |
| Toast | 22 toast | rises from below + blur · open 350 · close 250 · stays 5 s |
| SegmentedControl | 16 tabs sliding | the white pill slides 250 (symmetric) |
| Switch | 27 toggle | the knob slides (a transition, so a fast second click turns it back from where it is); small overshoot inside the 4 px inset |
| Checkbox, ChoiceCard | 25 checkbox check | box fills, then the tick draws |
| Field error | 12 error shake | the control shakes once on submit; message stays |
| Button loading | 04 text swap + 09 icon swap | label and icon swap in place; width stays |
| IconButton dot, Cuti count | 03 notification badge | dot slides on and pops from scale .5 (never from 0) |
| FileField upload done | spinner → check morph (pro) | the spinner becomes a check |
| Skeletons (StatTile, Table, cards) | 14 skeleton reveal | ease-in-out pulse, then cross-fade + blur to content |
| StatTile figure | 36 number subtle change | changed digits cross-fade up or down |
| AvatarStack | none | no hover motion: hover moves nothing (the faces stay in place) |
| EmptyState | 18 texts reveal | title and line rise in with a 40 ms stagger |
| Accordion | 21 accordion | grid rows 0fr → 1fr · chevron flips · 250 symmetric |
Rules
- Open and close are not symmetric: open 250 → close 150 (dropdown, modal); panel 400 → 350. Never delay a close.
- Symmetric motions keep one value both ways: tabs sliding, accordion, icon swap (250); text swap (150).
- Stagger 40 ms per item; keep the total under 300 ms.
- Reduced motion: reduce, do not delete. Travel, scale, bounce, shake and blur go away; a short 150 ms opacity fade stays on overlays, toasts and content swaps, so the eye still sees what changed. A switch knob moves at once.
- Hover changes colour only. Nothing moves on hover (no lift, no tilt).
Focus & disabled
Keyboard focus is never removed. Use :focus-visible so a mouse click does not show the ring.
Buttons and controls
outline: 2px solid var(--ring); outline-offset: 2px;Fields
0813 2045 7781
shadow-focus = inset 0 0 0 1px var(--ring), 0 0 0 1px var(--ring) (2px on the edge, no halo)Disabled
Kirim ke HR
--opacity-disabled 60 % (buttons, fields, switches) · --opacity-disabled-icon 40 % (icon-only)