Motion
How things move in BRICKS.
How things move in BRICKS: the durations and curves the library uses today, what each component does when it appears, changes or leaves, what never moves, and how reduced motion works. Every value marked In code is read from packages/bricks/src (CSS and TSX). Values marked Proposed are recommendations for the library; they are not implemented, and nothing in the library was changed to write this page.
Sources: kit/kit.css (overlays, controls, the reduced-motion block), shell/shell.css (menus, phone nav sheet), pr/pr.css, kit/patterns/patterns.css, kit/patterns/v3.css, blocks/blocks.css, styles/tokens.css, styles/themes/pr.css, shell/MobileNavSheet.tsx, kit/Toast.tsx, hooks/useReducedMotion.ts; the mocks reference/trndr-brand-dashboard-gui-v3.html and reference/trndr-pr-portal-gui-v3.html.
Principles
- Short. Nothing a person waits on runs longer than 250ms. Most motion is 140-200ms. Two exceptions: a progress bar's fill (300ms, the PR mock's
.bar i), which shows a value change and blocks nothing, and loading loops, which loop because the wait is real. - Quiet. Motion travels 1-10px or a panel's own width, fades from 0 to 1, never bounces, never overshoots, never scales up from nothing. Hover lifts 2px; press sinks 1px.
- Purposeful. Motion says where something came from (a drawer from the inline end, a menu from its trigger, a sheet from the nav's edge) or that work is happening (a spinner, a skeleton). It never decorates data.
- Directional in RTL. Anything that travels sideways mirrors in Arabic: drawers enter from the left, the nav sheet from the right, switch knobs travel the other way.
- Optional. With
prefers-reduced-motion: reduce, things appear and disappear without travelling, fading, pulsing or lifting. The only exception is the spinner, which keeps turning slowly, since it is the only sign of work.
Duration scale
Motion is not a token family in tokens.json. The only motion CSS variables are --drawer-dur and --drawer-ease (styles/tokens.css, overridden by the PR theme). Every other duration is a literal in a component's CSS. The scale below names the literals the code already uses.
| Step | Value | In code today | Used for |
|---|---|---|---|
| instant | 0ms | In code | reduced motion; content swaps (tabs, segments, rings, money, table re-sorts) |
| press | 80ms | In code | .kit-btn transform (press sink) |
| micro | 120ms | In code | .kit-btn border colour; RowList row background (.kit-tbl-row, 0.12s ease); MoneyNote popover fade |
| fast | 140-150ms | In code | menus and the notifications panel (140ms); hover lifts, field focus, nav item colour, icon buttons, choice cards, PR bulk bar (150ms) |
| base | 180-200ms | In code | scrim (200ms; sheet backdrop 180ms), modal, toast, save bar, brand drawer (--drawer-dur: 200ms), switch (200ms), nav sheet exit (200ms) |
| slow | 240-250ms | In code | nav sheet panel enter (240ms); PR drawer (--drawer-dur: 250ms); stepper bar colour (0.25s); PR row opacity (0.25s) |
| fill | 300ms | In code | progress bars (.kit-pr-track i, width 0.3s) |
| loop | 0.8s / 1s / 1.4s | In code | spinner (0.8s linear; 2.4s under reduced motion), shimmer (1s linear), skeleton pulse (1.4s ease-in-out) |
Proposed: name these as CSS custom properties in styles/tokens.css next to the drawer pair, so themes can tune them as the PR theme tunes the drawer: --motion-press: 80ms, --motion-fast: 150ms (fold 140ms into it), --motion-base: 200ms, --motion-slow: 250ms, --motion-fill: 300ms. Keep --drawer-dur as an alias of --motion-base (PR: --motion-slow).
Easing curves
| Name | Curve | In code today | Used for |
|---|---|---|---|
| standard | ease-out | In code (most rules) | everything that enters or reacts: scrim, modal, toast, menus, save bar, switch, hover lifts, brand drawer (--drawer-ease) |
| default | ease (no curve written, or written once) | In code | the PR rules written as 0.15s / 0.25s / 0.3s (choice card, icon button, PR tiles and challenge cards, stepper, track fill, row opacity); field border and shadow (150ms); RowList row background (0.12s ease, the one explicit ease) |
| emphasized decelerate | cubic-bezier(0.2, 0.8, 0.2, 1) | In code (PR theme --drawer-ease) | PR drawer; the PR mock's .drawer |
| sheet | cubic-bezier(0.32, 0.72, 0, 1) | In code (shell.css) | phone nav sheet panel, in and out |
| accelerate | ease-in | In code (once) | phone nav sheet backdrop fade-out |
| linear | linear | In code | spinner rotation, skeleton shimmer |
| pulse | ease-in-out | In code (once) | Skeleton pulse |
Proposed: one rule for new work. Entering and reacting use ease-out (or the emphasized curve for large panels); leaving uses ease-in; loops use linear (rotation, shimmer) or ease-in-out (pulse). Write the curve explicitly; do not rely on the default ease.
Enter, exit and distance
| Kind | Enter (In code) | Exit (In code) | Distance (In code) |
|---|---|---|---|
| Drawer | slide from the inline end, --drawer-dur / --drawer-ease | none: unmounts | translateX(110%) (RTL −110%) |
| Modal | fade 200ms ease-out | none | 0 (opacity only) |
| Toast | fade + rise 200ms ease-out | none (5s timer, then unmount) | 10px |
| Menu, notifications | fade + drop 140ms ease-out | none | 6px down from the trigger |
| Phone nav sheet | slide 240ms sheet curve; backdrop 180ms ease-out | slide back 200ms sheet curve; backdrop 200ms ease-in; unmount on animationend (fallback 400ms) | translateX(-100%) (RTL +100%) |
| Bars (save bar, PR bulk bar) | fade + rise 200ms / 150ms ease-out | none | 10px / 6px |
The nav sheet is the only exit animation in the library, and it already follows the asymmetry rule: exit is shorter than enter (200 vs 240ms) and the backdrop leaves on ease-in.
Proposed:
- Exit for every overlay, at about 75% of the enter duration on
ease-in, using the nav sheet's pattern (aclosingphase, unmount onanimationend, a fallback timer, no phase under reduced motion): drawer 150ms (PR 190ms) back totranslateX(110%); modal and scrim 150ms fade; toast 150ms fade + 10px drop; menus 100ms fade. Both mocks animate the drawer out, and the PR mock fades its modal and toast out. - Distance: 6px for small surfaces (menus, bars), 10px for toasts and the save bar, the full panel width for drawers and sheets. Never more than 10px for anything that is not a panel.
- Modal: keep the fade; optionally add the PR mock's 2% rise (
translate(-50%, -48%)to-50%) at 180-200ms.
What never animates
In code today none of these move, and they should stay that way:
- Money figures and counts: no count-up, no roll, no fade between values. A figure is a fact; a moving figure is misread mid-motion.
MoneyFigure,Money, KPI values, table cells. - Scores and gauges:
Ring,ScoreRing(a conic gradient) andGauge(SVG arcs) redraw at once. Both mocks agree. - Charts:
BarChart,AreaTrend,StackBar,HBars,ShareBardraw without growth animation. - Tables: re-sorting, filtering and paging replace rows at once; columns never slide.
DataTablerows have no hover fade either (onlyRowListrows fade, 0.12s). - Focus rings:
--focus-ringbox-shadows and outlines appear instantly (no rule transitionsbox-shadowon focus alone; fields transition border and shadow together for the hover and focus look, 150ms). - Selected state of tabs and segments: the pill jumps to the new option (the PR mock fades colour in 150ms; see differences).
- Layout: the sidebar's rail expand, page content and card grids change size at once.
- The MoneyNote popover's position:
.kit-note-popsetstransition-property: noneon purpose, since the reduced-motion reset would makeleftmove asynchronously and break the viewport clamp.
Reduced motion
In code: one block at the end of kit/kit.css (B26) under @media (prefers-reduced-motion: reduce). It loads with every part of the library (shell, blocks and PR pieces included).
animation: noneon: scrim, drawer (and its RTL rule), modal, toast, save bar, MoneyNote popover, notifications panel, skeleton (pulse and shimmer), PR bulk bar, topbar menus, the nav sheet panel and backdrop (enter and closing, RTL too).transition: noneon: nav items, nav chevron, HBars rows (no transition of their own), to-dos, cards, buttons, KPI cards, switches and knobs,RowListrows, fields, list toolbar inputs, lift cards, find-creators cards, PR choice cards, tiles, tracks, stepper bars, PR rows, receipt drop zone, icon buttons, PR challenge cards.transform: noneon hover lifts and press states (KPI card, lift cards, PR tiles, PR challenge cards, buttons, filter chips, segments, tabs, tiles, to-dos, coupon chip, nav items).- The spinner keeps turning, slowed from 0.8s to 2.4s.
- JS:
useReducedMotion()(exported) returns the media query and follows its changes.MobileNavSheetreads it and skips its closing phase; it also unmounts at once when the computedanimation-nameisnone.
Gaps (In code): the colour transitions on .kit-pr-mini-t > b and .kit-pr-minis--soft .kit-pr-mini-in (150ms) are not in the block. They change colour only, so they are harmless.
Proposed: any new motion adds its class to the B26 block in the same change, and any component that waits on animationend or transitionend reads useReducedMotion() as MobileNavSheet does. Reduced motion keeps opacity changes of 150ms or less only if a future audit shows they help comprehension; today they are removed, and that is the rule.
Catalogue
Trigger: what makes it move. All durations and curves are In code unless marked.
Overlays
| Component | What moves | How | Duration / easing | Trigger |
|---|---|---|---|---|
Drawer, DetailsDrawer (and every drawer built on Drawer: creator, challenge, product) | panel | kit-drawer-in: translateX(110%) → 0; RTL kit-drawer-in-rtl from −110% | var(--drawer-dur, 200ms) var(--drawer-ease, ease-out); PR theme 250ms cubic-bezier(0.2, 0.8, 0.2, 1) | open turns true; unmounts on false |
Drawer loading | body | DialogSkeleton shimmer (kit-sh: background-position to −200%) while loading; the dialog node stays mounted, so it slides in once | 1s linear, infinite | loading |
Modal | scrim and dialog | kit-fade-in: opacity 0 → 1 | 200ms ease-out | open |
| Scrim (drawer and modal) | backdrop | kit-fade-in | 200ms ease-out | open |
ToastRegion | toast | kit-slide-in: opacity 0 + translateY(10px) → none | 200ms ease-out; dismissed after 5000ms (DISMISS_MS) | toast set |
NotificationsMenu | panel | kit-pop: opacity 0 + translateY(-6px) → 0 | 140ms ease-out | bell click |
TopbarMenu, HeaderSearch results | popover | kit-shell-pop: opacity 0 + translateY(-6px) → 0 | 140ms ease-out | trigger click; typing |
MobileNavSheet | panel, backdrop | in: translateX(-100%) → 0 (RTL +100%), backdrop fade; out: back to −100%, backdrop fade out | in 240ms cubic-bezier(0.32, 0.72, 0, 1) / 180ms ease-out; out 200ms same curve / 200ms ease-in | open; unmounts on animationend or after 400ms |
MoneyNote popover | note | kit-fade-in | 120ms ease-out | label hover, focus, click |
Bars and feedback
| Component | What moves | How | Duration / easing | Trigger |
|---|---|---|---|---|
SaveBar | bar | kit-slide-in (10px) | 200ms ease-out | dirty turns true |
PrBulkBar | bar | kit-pr-fade: opacity 0 + translateY(6px) | 150ms ease-out | count > 0 (or persistent) |
BulkBar (brand) | none | appears at once | instant | count > 0 |
RowActions busy | spinner | kit-blk-spin: rotate 360deg | 0.8s linear, infinite (2.4s reduced) | an action's busy |
Skeleton, AsyncBlock loading | blocks | kit-skel: opacity 1 → 0.55 → 1 | 1.4s ease-in-out, infinite | state loading |
Copy feedback (CopyLink, CouponChip, CopyLinkField) | words | text swap, no motion; reset after 2000ms (2200ms for CopyLinkField, CustomerAffiliatesCard) | instant | click |
Controls
| Component | What moves | How | Duration / easing | Trigger |
|---|---|---|---|---|
Button | button | press: translateY(1px); border colour | transform 80ms ease-out; border 120ms ease-out | :active (not disabled), hover |
Switch (ios, compact, dark, sm) | track, knob | track background-color; knob transform (travel flips in RTL) | 200ms ease-out | checked |
Segmented | option | press scale(0.98); selection jumps | press only | :active, value |
PillTabs | tab | press scale(0.98); selection jumps | press only | :active, value |
FilterChips (.kit-chipf) | chip | press scale(0.98) | press only | :active |
Fields, ListToolbar search and selects, block inputs | border, shadow | border-color, box-shadow | 150ms (ease) | hover, focus |
Stepper | step bar | background-color | 0.25s (ease) | current |
ChoiceGroup / PR choice card | border, shadow | border-color, box-shadow | 0.15s | hover, selected |
PR icon button (.kit-pr-ib) | colours | background, border, colour | 0.15s | hover |
| Receipt drop zone | border, background | colour change | 0.15s | drag over |
| Sidebar nav item | background, colour; press | colour fade; translateY(1px) | 150ms ease-out | hover, :active |
| Nav group chevron | chevron | transform (rotation) | 150ms ease-out | group open |
Cards and rows
| Component | What moves | How | Duration / easing | Trigger |
|---|---|---|---|---|
KpiCard (with onClick) | card | translateY(-2px) + shadow 0 10px 22px rgba(20,20,20,.07) | 150ms ease-out | hover |
Lift cards (.kit-blk-lift: ChallengeCard, LiveChallengeCard, GroupCard, BonusCard, SettingsSection) | card | -2px + shadow | 150ms ease-out | hover |
FindCreatorCard (.kit-blk-fc) | card | -2px, shadow, border to rasp-100 | 150ms ease-out | hover |
PrChallengeCard (.kit-pr-chc), QueueTile (.kit-pr-tile) | card | -2px (+ shadow on the challenge card) | 0.15s | hover |
Tile (clickable), TodoItem, CouponChip | element | press translateY(1px) | instant (no transition) | :active |
RowList row (.kit-tbl-row, clickable) | background | fade to --row-hover | 0.12s ease | hover |
DataTable row | none | hover background swaps at once (dataTable.css has no transition) | instant | hover |
ApprovalRow (.kit-pr-jrow) | opacity | a busy row dims to 0.5 | 0.25s | busy |
TaskRow (.kit-pr-trow) | background | hover background | 0.15s | hover |
FraudCaseRow (.kit-pr-frow) | background | hover and selected background | 0.15s | hover, selected |
Progress (UsageBar, open rate, gift claims, brand stock) | fill | width | 0.3s (ease) | value change |
Mock vs library
Each row compares the v3 mocks' CSS with the library's:
| Area | Mocks | Library | Note |
|---|---|---|---|
| Overlay exit | brand and PR drawers slide out; PR modal and toast fade out | no exit (unmount) except the nav sheet | Proposed: add exits |
| Modal | brand: none; PR: opacity + 2% rise, 180ms | fade, 200ms | library sits between the two |
| Toast | brand: no motion, 2.2s; PR: 20px rise, 200ms, 2.4s or 5s with Undo | 10px, 200ms, 5s always | Proposed: 20px; keep 5s only when there is an action |
| Menus | PR .menu: rises 6px, 150ms ease | drops 6px, 140ms ease-out (as the notifications panel) | library is consistent across menus; keep |
| Button press | PR: scale(.97), 100ms; brand: none | translateY(1px), 80ms; segments, tabs, chips use scale(0.98) | Proposed: one press style (keep translateY(1px) for buttons, scale(0.98) for pills) and document it |
| Tabs, segments, chips | PR: colour fade 150ms | none | Proposed: background-color, color 150ms ease-out |
| Page change | PR: .page fade + 6px rise, 220ms | none | Proposed: optional AppShell content fade, 200ms, opacity only |
| Row leaving a queue | PR: opacity 0 + 30px slide, 250ms, removed after 240ms | removed at once | Proposed: an opt-in leaving row state, 200ms opacity + 30px, then unmount |
Sidebar toggle (PR .tog) | 150ms | Switch 200ms | keep 200ms (matches the .ios switch) |
| Loading | brand drawer: shimmer, 350ms fake wait | shimmer in dialogs; pulse in Skeleton | Proposed: one loading motion (the shimmer) for both |
| Drawer, notifications, bulk bar, switch, hover lifts, fields, stepper, bars | as library | as mocks | match |
Proposed changes, summarised
All Proposed; none is in the library today.
- Motion duration variables beside
--drawer-dur/--drawer-ease(--motion-press,--motion-fast,--motion-base,--motion-slow,--motion-fill). - Exit animations for Drawer, Modal, scrim, Toast, menus and the notifications panel, at about 75% of enter,
ease-in, with the nav sheet'sclosingphase pattern and reduced-motion bypass. - Explicit curves everywhere (no bare
ease):ease-outin,ease-inout, emphasized curve for panels. - Colour fade (150ms ease-out) on Segmented, PillTabs and filter chips.
- One loading motion: shimmer for
Skeletonas well as dialogs. - Toast: 20px rise; 5s only with an action, about 2.4s otherwise.
- Opt-in row exit for approval queues and a quiet page fade, both behind the reduced-motion rule.
- Add the two PR mini-stat colour transitions to the reduced-motion block for completeness.