Sign in

Why we keep design out of pages

Pages compose semantic components and carry no design of their own. That rule is what keeps a redesign from turning into a hunt through screens.

What a component owns

A component is named for what it means, takes domain values, and owns every design detail it needs.

  • Colours and spacing come from the theme, never from the page.
  • The page passes an account, never a class name.
  • A story shows every state the component can be in.
A page that carries a utility class has already started to drift.

What that looks like

A page reads as a sentence about the domain. It asks a context for an answer and hands it to a component, and neither half knows how the other works.

Elixir

  socket = assign(socket, :members, Accounts.list_members(scope, account_id))
LayerOwns
Pagewhat to show
Componenthow it looks
Contextwhat is true
Every layer answers one question.