Reuse first, in this order
- Reuse the component from the shared library as is. If it exists and fits, the task is done.
- Configure it through its props and slots. Variants, sizes, densities and states belong to the library.
- Compose two or more shared components into a small local component in the app that owns the screen. The composition is still all library parts.
- Extend the library when the same gap appears on a second screen or in a second app. The change goes into the library, behind a version bump, never into the app as a fork.
Tokens only
Colour, spacing, radius, shadow, typography and motion come from the token set the library consumes. A literal value in a screen (#1d4ed8, 17px, margin-top: 13px) is a defect even when it matches a token by eye — the point is that the value can change in one place.
- Web apps use the token-backed utilities of the styling system the app adopted; native apps read the theme (
useThemeColor), never literals (App standards). - Dark and light themes are the same tokens with different values. A colour picked for one theme is tested in the other.
- Logical direction is part of the token discipline: physical spacing and placement break right-to-left. The rules and the
rtl-physical:escape hatch are in Internationalisation and RTL.
Accessibility baseline
WCAG 2.2 level AA is the floor for every user-facing screen, in every theme and both directions. The recurring requirements:How the review runs
Accessibility is checked with evidence, not by score. Automated tools (axe, Lighthouse) cover only a subset of barriers, so the audit pairs them with manual interaction:- Run the automated audit on the rendered page and localize every failed node to a component.
- Inspect the accessibility tree for names, roles, states, landmarks and heading structure; walk the flow with the keyboard and, where possible, a screen reader.
- Fix the source, then re-run the same audit and the same manual pass.
a11y task on the built pages (App standards); each web app does the same when its first screen lands. Layout, direction and theme correctness is proved by the end-to-end matrix, not by unit tests.