Full answer
A design system is a set of tokens, components, rules and documentation that teams share. The hard part is not building it but getting it used and kept up to date. A rollout plan covers both the code and the people.
Foundation:
- Start with an audit of the current products to find the real, repeated patterns. Build the system from what teams use, and not from an ideal design.
- Ship tokens first. Colours, spacing and type are the cheapest to adopt and give quick visual consistency.
- Build a small set of components that cover most screens: button, input, form field, card, dialog and navigation. Make them accessible by default, with keyboard support, focus styles and correct roles, so teams do not need to solve it again.
Component design:
- A small, stable API. Variants through attributes or props, such as
data-variant="primary"anddata-size="lg", and defaults for everything. Avoid many one-off options. - Styles in a layer, using tokens, so that products can override with a simple rule.
- No dependency on page-global styles.
- Escape hatches that are documented, such as custom properties for the few things that teams may change.
Rollout and governance:
- Version it with semantic versions and a change log. Breaking changes need a migration path, codemods if possible, and a deprecation period with warnings.
- Documentation with live examples, usage rules and accessibility notes.
- A contribution process: how a team proposes a new component or a change, and who decides. Provide a way to ask questions, such as a channel and office hours.
- Adoption is gradual. Start with one product and one friendly team, use their feedback, and then widen. Let teams adopt component by component.
- Measure: share of components from the system, number of overrides, accessibility bugs, and time to build a screen. Use the data to decide what to improve.
- Add tests: visual regression for components and automated accessibility checks.
The default button uses the action colour. The second button changes variant and size through attributes, and the component keeps its own focus style. A product that wants a different look can override the tokens or add a rule in a later layer.
Treat the system as a product with users, a roadmap and support.
<style>
:root { --ds-color-action: #0a58ca; --ds-space-2: 8px; --ds-space-3: 12px; }
@layer ds {
.ds-btn { background: var(--ds-color-action); color: #fff; border: 0; padding: var(--ds-space-2) var(--ds-space-3); font: 16px sans-serif; }
.ds-btn[data-variant="secondary"] { background: #fff; color: var(--ds-color-action); outline: 1px solid var(--ds-color-action); }
.ds-btn[data-size="lg"] { padding: var(--ds-space-3) calc(2 * var(--ds-space-3)); font-size: 20px; }
.ds-btn:focus-visible { outline: 3px solid #111; outline-offset: 2px; }
}
</style>
<button class="ds-btn" id="a" type="button">Default</button>
<button class="ds-btn" id="b" type="button" data-variant="secondary" data-size="lg">Secondary large</button>Run in Chrome 156 (headless) as a page; the snippet is wrapped in a minimal HTML document with doctype, charset and viewport meta tag. Two full runs gave identical results, and the measured values in the answer come from them.
Key points
- Audit first, and build from real patterns.
- Tokens first, then a few accessible components.
- Stable API: variants as attributes, styles in a layer.
- Semantic versions, deprecation and migration paths.
- Docs, governance, tests and adoption metrics.
Common mistakes
- Building a large system before any team uses it.
- Making breaking changes with no migration path.
- Measuring nothing, so no one knows whether it helps.
Follow-ups
- Why ship tokens before components?
- How do you handle a breaking change?
Tips
- Separate the code (tokens, components) from the people part (versions, docs, governance, metrics).
- Describe a stable component API with variants and layers.