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.
socket = assign(socket, :members, Accounts.list_members(scope, account_id))
| Layer | Owns |
|---|---|
| Page | what to show |
| Component | how it looks |
| Context | what is true |