Skip to content
Primer printing platePrimer

Component guidance

Primer supplies tokens, review guidance, and copyable web controls for the three screen recipes. styles/controls.css implements the guidance-status button, field, row, navigation, and folio. Applications own behavior, routing, validation, and persistence, and they own the markup after copying examples/screens/. Catalog examples are ordinary HTML demonstrations. Specs in specs/ are the review contract. See elements.

The detailed core guidance covers navigation and icon actions, buttons and fields, menus and popovers, dialogs, cards and list rows, and folio headers. Other specifications remain outlines for further application review. Interaction specimens live in catalog/src/content/docs/patterns/interactions.mdx. Component specs live in specs/.

  • Anatomy and roles: start with a native element, label, content and any supporting or secondary action. Use semantic background, text, border, focus and accent roles. Keep decoration out of the accessible name.
  • States: identify rest, hover, focus, pressed/current, disabled, loading, invalid and empty states where applicable. Disabled controls do not act; loading is announced and prevents repeated submission where appropriate.
  • Pointer, keyboard and touch: use native activation and preserve visual order in tab order. Make secondary actions reachable without hover and target at least 44px for touch. Do not nest interactive controls.
  • Focus and accessibility: retain a visible focus indicator; label controls and associate help and errors. Current location uses aria-current. Give icon-only controls accessible names. Status updates should be announced without stealing focus.
  • Responsive behavior: preserve labels, actions, reading order and target sizes as space narrows. Wrap actions or switch to a named, focus-managed navigation layer instead of shrinking touch targets.

Buttons trigger actions and links navigate. Fields retain visible labels and show a specific associated error after validation. Menus expose their expanded state, move focus with arrow keys, dismiss on Escape and return focus; popovers dismiss when appropriate without trapping focus. Modal dialogs have an accessible name, contain focus, close on Escape and restore focus to their opener. Cards and rows keep independent actions as separate controls, available to keyboard and touch. A folio header groups title, context and actions, wrapping cleanly on narrow screens.