Surfaces

Introduce layering of components with ease.

Reach for it when
  • Laying out a page, a card, a panel or a menu: pick the surface for its depth in the stack, then the radius and shadow that go with it.
  • Hover, selected and pressed states come from the translucent fills, not from new colors.

The short version

If you read nothing else on this page, read these.

docs.acme.devLive
api.acme.devPublishing
staging.acme.devError
Do. Separate a surface with one hairline and a soft shadow.
docs.acme.devLive
api.acme.devPublishing
staging.acme.devError
Don't. Tint a surface, thicken its border or deepen its shadow to make it stand out.
docs.acme.devLive
api.acme.devPublishing
staging.acme.devError
Do. Show hover and selection with the translucent bg-hover and bg-selected.
docs.acme.devLive
api.acme.devPublishing
staging.acme.devError
Don't. Paint states with status colors. A green row reads as success, not as selected.

The stack

Seven surfaces, always nested in this order. Point at a layer in the key to lift it out.

bg-canvas
bg-page
bg-surface
surface-card
surface-inset
bg-fill
bg-overlay

In context

A slice of the dashboard in both themes. Turn on the labels to see which surface each part sits on.

Dashboard slice

The docs landing, as the product draws it. Nothing is wired up: the theme menu is pinned open, with the cursor on one item.

light
Light
Dark
System

api.acme.dev is publishing

Rebuilding from the latest commit on main. The current version stays up until it's live.

Your Docs sites

Search sites
Live
docs.acme.devacme/docs
Publishing
api.acme.devacme/api-reference
Failed
staging.acme.devacme/docs
help.acme.devLive
acme.docs.buildwithfern.comUnpublished
Ask anything
dark
Light
Dark
System

api.acme.dev is publishing

Rebuilding from the latest commit on main. The current version stays up until it's live.

Your Docs sites

Search sites
Live
docs.acme.devacme/docs
Publishing
api.acme.devacme/api-reference
Failed
staging.acme.devacme/docs
help.acme.devLive
acme.docs.buildwithfern.comUnpublished
Ask anything

Shape and depth

One base radius, scaled. Shadows light and tight.

Radius

Controls use rounded-md, cards rounded-lg, dialogs rounded-xl.

rounded-sm…
rounded-md…
rounded-lg…
rounded-xl…
rounded-2xl…
rounded-3xl…

Shadows

Cards get shadow-card, floating surfaces shadow-overlay. In dark mode the shadow stays black, and what floats adds a crisp light edge. The glows are for the agent only.

shadow-card
shadow-raised
shadow-frame
shadow-overlay
shadow-glow
shadow-glow-hover

Hover, selected and pressed

Translucent fills over whatever surface the control sits on. Press and hold the button.

HoveredSelectedOverlay

Keep going

Color
Semantically named colors and a set of ramps for the full palette. Optimized for light and dark.
Patterns
How components come together into pages.
Components
Shared components, from single controls to whole features.