Skip to Content
BBRICKSv0.7.4
Foundations

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

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.

StepValueIn code todayUsed for
instant0msIn codereduced motion; content swaps (tabs, segments, rings, money, table re-sorts)
press80msIn code.kit-btn transform (press sink)
micro120msIn code.kit-btn border colour; RowList row background (.kit-tbl-row, 0.12s ease); MoneyNote popover fade
fast140-150msIn codemenus and the notifications panel (140ms); hover lifts, field focus, nav item colour, icon buttons, choice cards, PR bulk bar (150ms)
base180-200msIn codescrim (200ms; sheet backdrop 180ms), modal, toast, save bar, brand drawer (--drawer-dur: 200ms), switch (200ms), nav sheet exit (200ms)
slow240-250msIn codenav sheet panel enter (240ms); PR drawer (--drawer-dur: 250ms); stepper bar colour (0.25s); PR row opacity (0.25s)
fill300msIn codeprogress bars (.kit-pr-track i, width 0.3s)
loop0.8s / 1s / 1.4sIn codespinner (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

NameCurveIn code todayUsed for
standardease-outIn code (most rules)everything that enters or reacts: scrim, modal, toast, menus, save bar, switch, hover lifts, brand drawer (--drawer-ease)
defaultease (no curve written, or written once)In codethe 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 deceleratecubic-bezier(0.2, 0.8, 0.2, 1)In code (PR theme --drawer-ease)PR drawer; the PR mock's .drawer
sheetcubic-bezier(0.32, 0.72, 0, 1)In code (shell.css)phone nav sheet panel, in and out
accelerateease-inIn code (once)phone nav sheet backdrop fade-out
linearlinearIn codespinner rotation, skeleton shimmer
pulseease-in-outIn 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

KindEnter (In code)Exit (In code)Distance (In code)
Drawerslide from the inline end, --drawer-dur / --drawer-easenone: unmountstranslateX(110%) (RTL −110%)
Modalfade 200ms ease-outnone0 (opacity only)
Toastfade + rise 200ms ease-outnone (5s timer, then unmount)10px
Menu, notificationsfade + drop 140ms ease-outnone6px down from the trigger
Phone nav sheetslide 240ms sheet curve; backdrop 180ms ease-outslide 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-outnone10px / 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 (a closing phase, unmount on animationend, a fallback timer, no phase under reduced motion): drawer 150ms (PR 190ms) back to translateX(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) and Gauge (SVG arcs) redraw at once. Both mocks agree.
  • Charts: BarChart, AreaTrend, StackBar, HBars, ShareBar draw without growth animation.
  • Tables: re-sorting, filtering and paging replace rows at once; columns never slide. DataTable rows have no hover fade either (only RowList rows fade, 0.12s).
  • Focus rings: --focus-ring box-shadows and outlines appear instantly (no rule transitions box-shadow on 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-pop sets transition-property: none on purpose, since the reduced-motion reset would make left move 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: none on: 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: none on: nav items, nav chevron, HBars rows (no transition of their own), to-dos, cards, buttons, KPI cards, switches and knobs, RowList rows, 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: none on 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. MobileNavSheet reads it and skips its closing phase; it also unmounts at once when the computed animation-name is none.

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

ComponentWhat movesHowDuration / easingTrigger
Drawer, DetailsDrawer (and every drawer built on Drawer: creator, challenge, product)panelkit-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 loadingbodyDialogSkeleton shimmer (kit-sh: background-position to −200%) while loading; the dialog node stays mounted, so it slides in once1s linear, infiniteloading
Modalscrim and dialogkit-fade-in: opacity 0 → 1200ms ease-outopen
Scrim (drawer and modal)backdropkit-fade-in200ms ease-outopen
ToastRegiontoastkit-slide-in: opacity 0 + translateY(10px) → none200ms ease-out; dismissed after 5000ms (DISMISS_MS)toast set
NotificationsMenupanelkit-pop: opacity 0 + translateY(-6px) → 0140ms ease-outbell click
TopbarMenu, HeaderSearch resultspopoverkit-shell-pop: opacity 0 + translateY(-6px) → 0140ms ease-outtrigger click; typing
MobileNavSheetpanel, backdropin: translateX(-100%) → 0 (RTL +100%), backdrop fade; out: back to −100%, backdrop fade outin 240ms cubic-bezier(0.32, 0.72, 0, 1) / 180ms ease-out; out 200ms same curve / 200ms ease-inopen; unmounts on animationend or after 400ms
MoneyNote popovernotekit-fade-in120ms ease-outlabel hover, focus, click

Bars and feedback

ComponentWhat movesHowDuration / easingTrigger
SaveBarbarkit-slide-in (10px)200ms ease-outdirty turns true
PrBulkBarbarkit-pr-fade: opacity 0 + translateY(6px)150ms ease-outcount > 0 (or persistent)
BulkBar (brand)noneappears at onceinstantcount > 0
RowActions busyspinnerkit-blk-spin: rotate 360deg0.8s linear, infinite (2.4s reduced)an action's busy
Skeleton, AsyncBlock loadingblockskit-skel: opacity 1 → 0.55 → 11.4s ease-in-out, infinitestate loading
Copy feedback (CopyLink, CouponChip, CopyLinkField)wordstext swap, no motion; reset after 2000ms (2200ms for CopyLinkField, CustomerAffiliatesCard)instantclick

Controls

ComponentWhat movesHowDuration / easingTrigger
Buttonbuttonpress: translateY(1px); border colourtransform 80ms ease-out; border 120ms ease-out:active (not disabled), hover
Switch (ios, compact, dark, sm)track, knobtrack background-color; knob transform (travel flips in RTL)200ms ease-outchecked
Segmentedoptionpress scale(0.98); selection jumpspress only:active, value
PillTabstabpress scale(0.98); selection jumpspress only:active, value
FilterChips (.kit-chipf)chippress scale(0.98)press only:active
Fields, ListToolbar search and selects, block inputsborder, shadowborder-color, box-shadow150ms (ease)hover, focus
Stepperstep barbackground-color0.25s (ease)current
ChoiceGroup / PR choice cardborder, shadowborder-color, box-shadow0.15shover, selected
PR icon button (.kit-pr-ib)coloursbackground, border, colour0.15shover
Receipt drop zoneborder, backgroundcolour change0.15sdrag over
Sidebar nav itembackground, colour; presscolour fade; translateY(1px)150ms ease-outhover, :active
Nav group chevronchevrontransform (rotation)150ms ease-outgroup open

Cards and rows

ComponentWhat movesHowDuration / easingTrigger
KpiCard (with onClick)cardtranslateY(-2px) + shadow 0 10px 22px rgba(20,20,20,.07)150ms ease-outhover
Lift cards (.kit-blk-lift: ChallengeCard, LiveChallengeCard, GroupCard, BonusCard, SettingsSection)card-2px + shadow150ms ease-outhover
FindCreatorCard (.kit-blk-fc)card-2px, shadow, border to rasp-100150ms ease-outhover
PrChallengeCard (.kit-pr-chc), QueueTile (.kit-pr-tile)card-2px (+ shadow on the challenge card)0.15shover
Tile (clickable), TodoItem, CouponChipelementpress translateY(1px)instant (no transition):active
RowList row (.kit-tbl-row, clickable)backgroundfade to --row-hover0.12s easehover
DataTable rownonehover background swaps at once (dataTable.css has no transition)instanthover
ApprovalRow (.kit-pr-jrow)opacitya busy row dims to 0.50.25sbusy
TaskRow (.kit-pr-trow)backgroundhover background0.15shover
FraudCaseRow (.kit-pr-frow)backgroundhover and selected background0.15shover, selected
Progress (UsageBar, open rate, gift claims, brand stock)fillwidth0.3s (ease)value change

Mock vs library

Each row compares the v3 mocks' CSS with the library's:

AreaMocksLibraryNote
Overlay exitbrand and PR drawers slide out; PR modal and toast fade outno exit (unmount) except the nav sheetProposed: add exits
Modalbrand: none; PR: opacity + 2% rise, 180msfade, 200mslibrary sits between the two
Toastbrand: no motion, 2.2s; PR: 20px rise, 200ms, 2.4s or 5s with Undo10px, 200ms, 5s alwaysProposed: 20px; keep 5s only when there is an action
MenusPR .menu: rises 6px, 150ms easedrops 6px, 140ms ease-out (as the notifications panel)library is consistent across menus; keep
Button pressPR: scale(.97), 100ms; brand: nonetranslateY(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, chipsPR: colour fade 150msnoneProposed: background-color, color 150ms ease-out
Page changePR: .page fade + 6px rise, 220msnoneProposed: optional AppShell content fade, 200ms, opacity only
Row leaving a queuePR: opacity 0 + 30px slide, 250ms, removed after 240msremoved at onceProposed: an opt-in leaving row state, 200ms opacity + 30px, then unmount
Sidebar toggle (PR .tog)150msSwitch 200mskeep 200ms (matches the .ios switch)
Loadingbrand drawer: shimmer, 350ms fake waitshimmer in dialogs; pulse in SkeletonProposed: one loading motion (the shimmer) for both
Drawer, notifications, bulk bar, switch, hover lifts, fields, stepper, barsas libraryas mocksmatch

Proposed changes, summarised

All Proposed; none is in the library today.

  1. Motion duration variables beside --drawer-dur / --drawer-ease (--motion-press, --motion-fast, --motion-base, --motion-slow, --motion-fill).
  2. Exit animations for Drawer, Modal, scrim, Toast, menus and the notifications panel, at about 75% of enter, ease-in, with the nav sheet's closing phase pattern and reduced-motion bypass.
  3. Explicit curves everywhere (no bare ease): ease-out in, ease-in out, emphasized curve for panels.
  4. Colour fade (150ms ease-out) on Segmented, PillTabs and filter chips.
  5. One loading motion: shimmer for Skeleton as well as dialogs.
  6. Toast: 20px rise; 5s only with an action, about 2.4s otherwise.
  7. Opt-in row exit for approval queues and a quiet page fade, both behind the reduced-motion rule.
  8. Add the two PR mini-stat colour transitions to the reduced-motion block for completeness.

On this page