Orbex Sonar-DB Design system , home

Springs

Springs are described as designers talk about them: a duration, the time the spring takes to settle within 0.2% of its target, and a bounce. The build turns each pair into a CSS linear() curve, so the motion runs like any transition, with no JavaScript.

Spatial springs move things: position, size, shape. Effects springs change how things look: opacity and color. Effects are quicker, because a fade that lags reads as slowness.

sonar-motion-spatial-fast

200 ms, bounce 0

Small elements: switches, chips, menus.

sonar-motion-spatial-default

320 ms, bounce 0

Most layout changes: accordions, cards settling, panels resizing.

sonar-motion-spatial-expressive

500 ms, bounce 0.3

Only when a dragged card is dropped and for success confirmations.

sonar-motion-effects-fast

138 ms, bounce 0

sonar-motion-effects-default

212 ms, bounce 0

sonar-motion-effects-slow

300 ms, bounce 0

Easing curves

Cubic curves for what is not a spring: leaving the screen, entering panels, the sidebar folding, the theme switch and cards changing columns.

sonar-motion-easing-exit

400 ms

Leaving the screen: starts at once and accelerates.

sonar-motion-easing-decelerate

400 ms

Entering elements that are not springs, such as panels.

sonar-motion-easing-standard

400 ms

Continuous transforms such as the sidebar folding.

sonar-motion-easing-accelerate

400 ms

Panels and sheets leaving: starts slow and leaves at speed.

sonar-motion-easing-emphasized

400 ms

The theme switch’s knob and cards moving between columns.

sonar-motion-easing-crossfade

400 ms

The page cross-fading from one theme to the other.

Durations

Fixed durations for the moments that are not a spring. Each is used with the easing named beside it in the guidelines below.

TokenValueUse
--sonar-motion-duration-state 160ms Hover and pressed colors of rows, pills and buttons, with easing.decelerate.
--sonar-motion-duration-panel-enter 420ms A side panel or a phone sheet arriving: its slide uses the spatial default spring stretched to this time.
--sonar-motion-duration-panel-exit 150ms A side panel leaving: 28 px and out of sight, with easing.accelerate.
--sonar-motion-duration-sheet-fade 200ms A phone sheet’s opacity while it rises.
--sonar-motion-duration-sheet-exit 220ms A phone sheet going down, with easing.accelerate.
--sonar-motion-duration-menu-exit 110ms A menu closing to 96 %, with easing.exit.
--sonar-motion-duration-dropdown 180ms The search results opening, with easing.decelerate.
--sonar-motion-duration-tooltip-delay 300ms The pointer rests this long before a tooltip opens.
--sonar-motion-duration-tooltip-enter 140ms A tooltip opening from 96 %, with easing.decelerate.
--sonar-motion-duration-tooltip-exit 90ms A tooltip fading out, with easing.exit.
--sonar-motion-duration-theme 700ms The cross-fade of the whole page when the theme changes, with easing.crossfade.
--sonar-motion-duration-theme-fallback 250ms Color transitions when a browser cannot cross-fade the page.
--sonar-motion-duration-reflow 620ms Cards moving to new places when the number of columns changes, with easing.emphasized.

Theme switch

Changing the theme is two steps. The switch’s knob slides first, in 200 ms on --sonar-motion-easing-emphasized. At 200 ms the whole page cross-fades into the new theme with a View Transition: 700 ms on --sonar-motion-easing-crossfade. Nothing changes color out of step, because the page fades as one picture.

Browsers without View Transitions ease every color over 250 ms instead. With reduced motion requested, the theme changes at once.

css
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: var(--sonar-motion-duration-theme);          /* 700ms */
  animation-timing-function: var(--sonar-motion-easing-crossfade); /* cubic-bezier(.4,0,.2,1) */
}

/* Without View Transitions: colors ease */
.sonar-theming, .sonar-theming * {
  transition: color var(--sonar-motion-duration-theme-fallback) ease,
              background-color var(--sonar-motion-duration-theme-fallback) ease !important;
}
js
function switchTheme(next) {
  const apply = () => (document.documentElement.dataset.theme = next)
  if (matchMedia('(prefers-reduced-motion: reduce)').matches) return apply()
  if (document.startViewTransition) {
    // the knob slides first (200 ms), then the page cross-fades
    return setTimeout(() => document.startViewTransition(apply), 200)
  }
  document.documentElement.classList.add('sonar-theming')
  apply()
  setTimeout(() => document.documentElement.classList.remove('sonar-theming'), 300)
}

In code

Every spring is two custom properties, a duration and an easing, always used together.

css
.accordion-panel {
  transition: height var(--sonar-motion-spatial-default-duration)
                     var(--sonar-motion-spatial-default-easing);
}

.menu {
  transition: opacity var(--sonar-motion-effects-fast-duration)
                      var(--sonar-motion-effects-fast-easing);
}

Guidelines

  • Bounce only when a dragged card lands in its slot and when an action succeeds. Everywhere else, motion settles without overshoot.
  • Side panels enter from 48 px in 420 ms with a fade, and leave by 28 px in 150 ms on the accelerate curve. On tablets the panel slides all the way in from the right edge on the default spatial spring (320 ms) and back out the same way, as Navigation by device shows. On phones the sheet rises in 420 ms (fade 200 ms) and drops in 220 ms.
  • Menus open from 0.9 in 200 ms with a 138 ms fade, and close to 0.96 in 110 ms on cubic-bezier(.3,0,.8,.15). The search list drops 4 px from 0.98 in 180 ms.
  • Tooltips wait 300 ms, then grow from 0.96 in 140 ms; they leave with a 90 ms fade. The chart bubble only fades, in 200 ms.
  • Hover and other state changes take 160 ms on cubic-bezier(.23,1,.32,1).
  • Editing the overview: a lifted card grows to 1.03 (200 ms) and rises to elevation 4; its height follows in 320 ms. Dropped, it settles in 500 ms on the expressive spring. Neighbors and resizes move in 320 ms. When the column count changes, cards travel to their new places in 620 ms on cubic-bezier(.2,0,0,1).
  • Theme changes never move content: only the switch’s knob slides, then the page fades.
  • With reduced motion requested, spatial movement is replaced by an immediate change; fades stay, shortened, to keep the change perceptible.