fndn/ui

Foundations

Motion

Durations and easings are tokens, combined into a few named timings; a recipe uses only those timings, through the motion-<what>-<timing> utilities. The view options in the top bar slow everything down at once.

Timings

Named timings for transitions: [duration token, easing token or CSS keyword]. They become the motion-<what>-<name> utilities of the Tailwind preset (motion-colors-fast, motion-transform-press). These are the only timings a recipe can use.

TimingDurationEasingUtilitySample
fastduration.fast 100mseasemotion-colors-fast
baseduration.base 150mseasemotion-colors-base
slowduration.slow 250mseasemotion-colors-slow
pressduration.press 160mseasing.out-strongmotion-colors-press
moveduration.move 200mseasing.out-strongmotion-colors-move
glideduration.move 200mseasing.movemotion-colors-glide
revealduration.reveal 200mseasing.out-strongmotion-colors-reveal
popupduration.popup 180mseasing.out-strongmotion-colors-popup
tooltipduration.tooltip 125mseasing.out-strongmotion-colors-tooltip
enterduration.enter 300mseasing.out-strongmotion-colors-enter
fast-outduration.fast 100mseasing.out-strongmotion-colors-fast-out
base-outduration.base 150mseasing.out-strongmotion-colors-base-out
slow-outduration.slow 250mseasing.out-strongmotion-colors-slow-out

The motion utilities

motion-<what>-<timing> transitions one family of properties with a named timing. Several combine on one element (motion-colors-fast motion-transform-press): each sets its own part of the transition.

  • motion-colors-*color, background, border, outline, text-decoration, fill, stroke
  • motion-opacity-*opacity
  • motion-shadow-*box-shadow
  • motion-transform-*transform, translate, scale, rotate
  • motion-filter-*filter, backdrop-filter
  • motion-size-*width, height, grid tracks
  • motion-radius-*border-radius
  • motion-also-[…]any other transition, added to the ones above (display for an exit, for example)

Durations

UI motion stays under 300ms. Every transition and animation takes its duration from here; literal durations are a lint error (loops excepted).

TokenValueReducedUseSample
--fndn-duration-fast100mssameHover and colour feedback.
--fndn-duration-base150mssameSmall state changes: colour, opacity, focus rings.
--fndn-duration-press160mssamePress feedback (scale on :active).
--fndn-duration-tooltip125mssameTooltips and other tiny popovers.
--fndn-duration-popup180mssameSelects, menus, popovers, hover cards.
--fndn-duration-reveal200ms0msCollapsible regions (the one sanctioned height-like animation).
--fndn-duration-move200ms0msOn-screen travel: sliding thumbs, gliding highlights, chevron rotation.
--fndn-duration-slow250mssameDialogs and larger surfaces.
--fndn-duration-enter300mssameOne-shot entrances of content (fade-up). The upper bound for UI.
--fndn-duration-stagger40ms0msDelay between items of a group entrance (30–80ms budget). Cap the multiplier so a long list never waits.
--fndn-duration-sweep1000ms0msThe prompt bar's send sweep: a decorative band crossing the composer once. Longer than any UI motion on purpose, so the band is seen travelling. Not for anything a user waits on.

Easings

TokenCurveUseSample
--fndn-easing-out-strongcubic-bezier(0.23, 1, 0.32, 1)Strong ease-out. Entrances, exits, press feedback, reveals, popups.
--fndn-easing-in-out-strongcubic-bezier(0.77, 0, 0.175, 1)Strong ease-in-out. Elements that are already on screen and travel or morph.
--fndn-easing-movecubic-bezier(0.77, 0, 0.175, 1)Sliding indicators (segmented thumb, switch thumb). Aliases in-out-strong; change here to retune every indicator at once.
--fndn-easing-drawercubic-bezier(0.32, 0.72, 0, 1)iOS-like sheet/drawer curve.
--fndn-easing-linkcubic-bezier(0.16, 1, 0.3, 1)Animated link underline.

Motion values

TokenValueReducedUse
--fndn-motion-press-scale0.97sameScale of a pressed button, chip or icon button. Subtle: 0.95–0.98.
--fndn-motion-press-scale-sm0.9sameScale of a pressed control of 20px or less (checkbox box, radio, switch thumb). 0.97 moves a 16px box by under half a pixel, which cannot be seen.
--fndn-motion-enter-shift8px0pxRise of a one-shot entrance (fndn-fade-up).
--fndn-motion-popup-scale0.961Closed-state scale of trigger-anchored popups. Never 0; nothing appears from nothing.
--fndn-motion-sheet-shift100%0%How far a closed sheet (drawer) sits past its edge. Reduced motion: none, the sheet fades in place.
--fndn-motion-stagger-max5sameLargest stagger multiplier. Items past it arrive with the last staggered one.
--fndn-motion-carousel-depth-scale0.941Scale of a carousel slide (effect depth) as it starts to enter or finishes leaving the view; full size once it is all in view. Reduced motion: none.
--fndn-motion-carousel-depth-opacity0.51Opacity of a carousel slide (effect depth) at the same moments as its scale. Reduced motion: none, the slide only scrolls.
--fndn-motion-carousel-parallax-shift0.20How far the picture of a carousel slide (effect parallax) lags its slide when the slide is wholly out of view, as a share of the width of the picture's frame (0.2: a fifth of it); the picture is that much wider on each side. Reduced motion: none, the picture moves with its slide.