Skip to content

Foundations

Elevation and shape

Four surface levels, radii that follow size, two stroke widths and short motion.

Levels
0 to 3
Radii
3, 4, 6, 8, 12px and full
Strokes
1px, 2px
Motion
240ms at most; 320ms for large panels

Four levels

Levels 2 and 3 float over content. Never skip a level, and never nest a surface inside one of the same level.

The four elevation levels
LevelUse forLightDark
0 CanvasThe page.#fdfdfd#151515
1 RaisedPanels, table and chart frames, stat strips, current nav item, top bar.White, hairline, 0 0 2px and 0 2px 4px at 8% ink#1c1c1c, hairline, lit top edge; fields #2c2c2c
2 OverlayMenus, popovers, toasts, chart readouts.White, hairline, 0 0 2px at 12%, 0 8px 16px at 14% ink#333333, hairline, lit top edge, heavier shadow
3 ModalDialogs, over a scrim.White, hairline, 0 0 8px at 12%, 0 32px 64px at 20% ink; 56% scrimTwo steps lighter, hairline; 72% scrim

Shape

The radius follows the element's size. Nested corners stay concentric: the outer radius is the inner radius plus the gap. Where the browser supports it (Chrome), corners are continuous, as on iPhone.

Radii and where they apply
RadiusUse for
3pxMarks 24px and under: tags, kbd, checkboxes, inline code; hover shapes of tabs, nav and menu items.
4pxButtons, inputs, selects, tooltips, the segmented thumb.
6pxThe segmented track.
8pxMenus, popovers, toasts, banners, chart readouts, message bubbles; panels, cards, table and chart frames, stat strips, dialogs, drawers, code blocks.
12pxThe composer only.
FullStatus dots, avatars, switches, meter tracks. Never anything with a label.

One surface per region

Tables, charts and stat strips are surfaces, so they sit on the canvas, not in a panel. Feedback surfaces add only a leading status bar.

Open requests

4 need review today.

One surface.Spacing and hairlines inside.

Open requests

4 need review today.

A box inside a box.Hides what matters.

Strokes

Borders are 1px. Tab and nav location markers and the focus ring are 2px. Never 3px or half a pixel.

Motion

Motion only confirms a change. It lasts 240ms at most, 320ms for large panels, and turns off under reduced motion. Slow motion, in the header, plays it at a quarter speed.

If your system is set to reduce motion, the square jumps: that is the tokens resolving to 0ms, not a bug.

Rules

Every component follows these. Follow them in anything you add.

Motion rules
RuleValueSee it
Things that appear start fast and settle.Ease out, --sg-motion-easing-enterMenu
Things that leave speed up, and take 20% less time than they took to come.Ease in, --sg-motion-easing-exit. A menu opens in 160ms and closes in 128ms.Menu
Things that move between two places speed up, then slow down.Ease in and out, --sg-motion-easing-moveSwitch
A menu or popover grows out of its trigger and shrinks back toward it.Opens from 90% of its size, closes to 95%Menu
A pressed control answers on the press itself.Scale 0.995, no delayButton
A held switch thumb stretches toward where it will go.12% widerSwitch
What you drag follows the pointer exactly, and animates only when let go.No easing while heldDrawer
Dragged past where it can go, it resists more and more.A rubber band that tops out at a tenth of its widthToast
A list that arrives for the first time comes in row by row.30ms apart, the first ten rows. Never on sort or filter.Below
New content fades in where the old content was.160msTabs
An icon that changes crossfades into the next.The old one shrinks, fades and blurs out in 160msCopy, on this site
An object that travels across the screen follows an arc.The move curve
A finished action shows that it worked before its panel closes.A check and "Saved" for 600msBusy button
A control keeps its size when its label changes.Its labels share one cellBusy button
A new action takes over a running animation from where it is.Transitions, never keyframes, for stateDrawer
Everyday motion never overshoots or bounces.No springs

A list's first load

Animate

  • Hover, press and focus color and border: 100ms.
  • Menus, tabs and disclosure: 160ms.
  • Dialogs and scrims: 240ms.
  • Drawers and large panels: up to 320ms.
  • Meter fills, and looping live activity: loader, typing, recording.

Do not animate

  • Pulsing, bouncing, shimmering or marquee.
  • Layout.
  • Page transitions.
  • Data changing in a table, beyond a brief tint on the changed cell.
  • A list that is sorted or filtered.

Layers

Dialogs and popovers use the top layer and need no z-index. Everything else that stacks uses these tokens.

Stacking layers
TokenValueUse for
--sg-layer-sticky100Sticky table headers and bars.
--sg-layer-overlay200Overlays outside the top layer, such as the chart readout.
--sg-layer-toast300The toast region, above sticky bars.
--sg-layer-tooltip400Tooltips, topmost.