Skip to content
Brand & UX guide
Components

Components

Every UI element the app uses. Start with the decision table, then open the page for the group you need.

#Which component?

Find what the person needs to do or see, and use the component in the right-hand column. If nothing fits, compose existing ones before proposing a new one.

The person needs to…UsePage
Start or confirm something (save, connect, continue).btn .btn-primary, one per viewButton
Go somewhere else in the product.btn-link or a nav itemInline link
Do something risky or irreversible.btn-danger, never the primaryButton
See a status (ready, waiting, failed, latest)Pill with a tonePill
Type something in.field with a labelField
Choose one of a few options at onceSegmented controlTheme switch
Answer “how are we doing?”Pulse strip of metric tilesMetric tile
See a change against last weekDeltaDelta
See the recent shape of a numberSparklineSparkline
Compare items in one list (products, channels)Rank barsRank bars
Browse past weekly packsWeekly timelineTimeline
Know the one thing to do this weekAction bandAction band
Know a report is on its wayStatus panelStatus panel
Leave Weekwright to pay or approve accessHandoff modalHandoff
Find a page, store, or reportSidebar and breadcrumbSidebar
Group related content.card, with an .inset insideCard

#The groups

#Rules that apply to every component

Use roles, never raw valuesColors, spacing, radius, and type come from tokens. A new value becomes a token first.
Compose before you createPrefer existing primitives to page-specific CSS. Inline style is only for data, such as a bar width.
Status is never color alonePair color with words, an arrow, or an icon. Test it in grayscale.
Both themes, every timeA component is not done until it reads in light and dark. Use the Light and Dark buttons on each specimen here.
Keyboard firstEverything interactive shows a 2px focus ring, is reachable by Tab, and works with Enter or Space.
Ship a testIn the app, every component and page file needs 100% test coverage. New primitives arrive with tests.

#Adding a component

  1. Check the table above. Could an existing component do the job?
  2. Add tokens first, then CSS in the app’s components.css, then a React primitive only if it carries logic.
  3. Add a tested example in the app, then run npm run sync here and add a specimen page entry with “use when” and “don’t use when”.
  4. Add a row to the table above.
Weekwright brand & UX guide v1.0.0 Components rendered from app @ bd6c1f4 · build d2e1ef8