FoundationsComposition
Composition
The composition method and the canonical layer stack every screen is built from.
Method
- Name the job — the one primary action or piece of information.
- Choose the layer — base / raised / sticky / dropdown / overlay / toast. Default: base.
- Choose the dominant alignment method — left edge by default; add a second (spine/baseline) only if needed.
- Establish the primary edge — one left edge for title, sections, rows, fields.
- Set vertical rhythm — space in multiples of 4px; type roles carry size/leading.
- Group by proximity — tight spacing = related, loose = separated.
- Only then add a container — a card is one step of depth, not two.
- Spine for mixed-bound controls — align icon/control centres to a vertical spine; keep text on the primary edge.
- Correct optically — trim top padding under a leading title; optically centre icons.
- Design every state — rest / hover / active / focus-visible / disabled / loading / selected / empty / error.
- Audit — count alignment rules/methods and depth layers; collapse whichever exceeds what the content needs.
Layer stack
| Layer | z | Contents | Separation |
|---|---|---|---|
| base | 0 | page background, normal content | none |
| raised | 10 | cards, panels, active chips | hairline / small shadow |
| sticky | 20 | sticky headers, nav bars, tab bars | backdrop blur + saturate |
| dropdown | 30 | menus, popovers, tooltips, selects | floating shadow (stacked) |
| overlay | 40 | scrim / backdrop behind modals + drawers | scrim fill |
| modal | 50 | modal dialogs, side trays, drawers | overlay shadow |
| toast | 60 | transient notifications | floating shadow |