skip to content

Documentation & Guidance

Documentation turns a component library into a usable system: a clear site structure, usage guidance that explains when and why, and pages that stay true to the code. Undocumented systems get forked.

part ofDesign systems & UX foundationsoverview, primer and where to startread it →
on this pageshow

explore

questions

12

In a design system's documentation site, what sections should every component page share, and why use one fixed template for all of them?

level: middleimportance: must knowfreq 42%

answer

  1. the same order on every page
  2. what, when, parts, variants
  3. API per platform
  4. accessibility and content guidance
  5. gaps become visible

basics

~20 s

Overview, usage, anatomy, variants and states, API, accessibility and content guidance, in the same order on every page. A fixed template lets readers jump straight to what they need and makes missing sections obvious to authors.

solid answer

~40 s

I would give every component page the same sections in the same order: an **overview** saying what it is with a live example; **usage**, meaning when to use it, when not to and what to use instead; **anatomy**, naming each part; **variants and states**; the **API** reference, switchable per platform; **accessibility**, covering built-in behaviour and what the consumer must still do; **content guidance** for labels and messages; and **related** components and patterns. One fixed template matters because readers learn the layout once and then jump straight to the section they need on any page. It also works as a **completeness check** for authors - an empty accessibility section is visible - and makes components comparable. Sections that do not apply say so rather than disappearing.

go deeper

for a junior

Recall the standard sections - overview, usage, anatomy, variants and states, API, accessibility, content, related - and what question each answers.

for a middle

Explain why a fixed template helps readers and authors, and how one page serves designers, engineers and several platforms without hiding anything.

for a senior

Show how you would introduce or change a template across hundreds of existing pages, and enforce it through review without stalling contributions.

for a principal

Weigh template rigidity against the needs of unusual components, and how the documentation structure signals what the organisation treats as essential.

## What a component page template is A **page template** is the fixed set of sections, in a fixed order, that every component page on a design system's documentation site follows. It is to documentation what a component is to interface: a reusable structure that makes each instance predictable. ## The sections and what each answers | Section | Question it answers | Typical content | Main reader | |---|---|---|---| | Overview | What is this? | one-sentence purpose, a live example | everyone | | Usage | When should I use it, and when not? | guidance, alternatives, do and don't examples | designers, product managers | | Anatomy | What are its parts called? | labelled diagram of each part | designers, engineers | | Variants and states | What forms does it take? | sizes, emphasis levels, states such as disabled or error | designers, engineers | | API | How do I build with it? | properties, events, slots, per platform | engineers | | Accessibility | What does it handle, and what must I do? | keyboard interaction, announcements, consumer obligations | everyone | | Content | What should the text say? | label length, tone, capitalisation, error message rules | writers, designers | | Related | What else should I look at? | similar components, patterns it appears in | everyone | The order follows the reader's journey: first decide whether this is the right component, then learn its shape, then build it, then check it is accessible and well written. ## Why one fixed template 1. **Predictability**: readers learn the layout once. On any page they can jump directly to the API or the accessibility section without scanning. 2. **Completeness**: a template makes gaps visible. If a page's accessibility section is empty, everyone can see it; with free-form pages, missing guidance is invisible. 3. **Comparability**: a designer choosing between two similar components can read the same sections side by side. 4. **Authoring speed**: new pages start from the template, and contributors know what is expected. 5. **Tooling**: consistent structure lets parts of the page, such as the API reference, be produced from the source code rather than written by hand. ## Serving several audiences and platforms One page serves designers, engineers and writers, on web and native mobile. Two common layouts: - **Tabs by discipline** (usage, design, code, accessibility): shorter views, but content on another tab can be missed; an engineer may never open the usage tab. - **One long page with a sticky table of contents**: everything visible and searchable in one place, but longer to scroll. Both are defensible. What matters is that **accessibility and usage are not hidden** from the people who most need them, and that platform differences are handled with a **platform switcher** on the API and implementation sections, so a native mobile engineer sees their platform's properties while shared guidance stays the same. ## Keeping the template lean - A section that does not apply is marked **not applicable**, with a reason, rather than removed; readers then know it was considered. - The template should be revised rarely and deliberately, since every change touches every page. - Extra sections for one unusual component are added below the standard ones, so the shared order is unchanged. ## Applying it On a museum ticketing kiosk team, a designer looking at the **ticket-type selector** reads the usage section to confirm it fits a single choice among adult, child and concession tickets, checks the anatomy to name its parts in the handoff, and points the engineer to the accessibility section for the keyboard and screen reader behaviour. The engineer switches the API section to the kiosk's platform. Neither reads the whole page, and neither has to hunt. ## Common mistakes - Free-form pages that each component owner structures differently. - An API reference with no usage guidance, so teams know how but not when. - Accessibility treated as optional and left out of the template. - Separate design and engineering sites with no shared page, so the two disciplines read different truths. - Changing the template's section order on some pages but not others during a gradual migration, so readers' learned navigation stops working.

  • Should a component page split design and engineering content into tabs, or keep one long page?
    Either works if nothing essential is hidden. Tabs give shorter views but let readers skip the tab they most need, such as engineers missing usage guidance. A single page with a sticky table of contents keeps everything visible and searchable. Whichever you choose, keep accessibility and usage reachable by every reader and put platform differences behind a switcher.
  • What should the template do when a section does not apply to a component?
    Keep the heading and say it does not apply, with a short reason - for example, a purely decorative divider has no keyboard interaction. Removing the section makes readers wonder whether it was forgotten, and it breaks the predictable order that lets them jump straight to a section.
  • How does a fixed template help the system team, not only readers?
    It turns documentation into a checklist: reviewers can see at a glance which pages lack accessibility or content guidance. New contributors start from a known shape. And consistent structure lets parts such as the API reference be generated, reducing hand-maintained text.

saying these in an interview costs you the question

  • Each component owner should structure their page however suits the component.
  • An API reference is enough documentation for a component.
  • Sections that do not apply should simply be deleted from that page.
  • Designers and engineers are best served by separate sites with no shared page.
  • Accessibility guidance belongs in a separate section of the site, not on component pages.
open as a page

In a design system, why keep component documentation as code beside the component rather than in a separate wiki?

level: juniorimportance: should knowfreq 36%

basics

~20 s

Docs kept beside the component change in the same review as its code, are versioned and released with it, and can be checked by the build, so an API change without a docs update is caught instead of drifting silently.

open as a page

In a design system's documentation site, why separate foundations, components and patterns, and what belongs in each section?

level: juniorimportance: should knowfreq 38%

basics

~20 s

Each answers a different question. Foundations hold shared rules - color, type, spacing, motion, icons, accessibility principles. Components document each reusable part. Patterns show how parts combine for recurring tasks. Separating them lets readers find answers by the kind of question.

open as a page

In a design system's documentation, what makes a component's usage guideline useful, and why pair each do with a don't and a reason?

level: juniorimportance: should knowfreq 38%

basics

~20 s

A useful usage guideline says when to use a component, when not to and what to use instead. Pairing each do with a don't and a stated reason shows the boundary and lets readers judge cases the page never listed.

open as a page

In a component library's documentation, why generate property tables from the source and render live examples instead of writing them by hand?

level: middleimportance: should knowfreq 33%

basics

~20 s

Hand-copied property tables and pasted snippets go wrong the moment a property changes. Generated tables read names, types and defaults from the component's source, and examples the docs build renders turn API drift into a build failure.

open as a page

On a design system's component documentation page, what should the accessibility section tell designers and engineers who use the component?

level: middleimportance: should knowfreq 30%

basics

~20 s

What the component already handles - its role, keyboard interaction and announcements - and what consumers must still do, such as supplying a meaningful label, preserving contrast and target size in their layout, and testing the finished page.

open as a page

In a design system, how should usage guidance help teams choose between look-alike components such as a toast and an inline banner?

level: middleimportance: should knowfreq 34%

basics

~20 s

Guidance should separate look-alikes by the user's situation, not their appearance: a few deciding questions (persistence, required action, scope, urgency), one shared comparison table for the family, and reciprocal 'use this instead' links between their pages.

open as a page

In a music-streaming app's design system, teams say the docs are always out of date; how would you detect stale pages and make someone own fixing them?

level: seniorimportance: should knowfreq 28%

basics

~20 s

Split the complaint into wrong, missing and unfindable pages, and detect each: code changed after its page, failing examples, zero-result searches, negative feedback, support threads correcting the docs. Give every page a named owner and route fixes to them.

open as a page

A design system's docs site has 150 pages, yet a museum kiosk team keeps asking in chat where idle-timeout guidance lives and which component to use. How do you fix the structure?

level: seniorimportance: should knowfreq 24%

basics

~20 s

Treat it as an information-architecture problem: learn where readers expect answers from their chat questions, their wording and a tree test. Then organise around tasks - named pattern pages, readers' synonyms, cross-links from components to patterns, and audience entry points.

open as a page

In a car-rental site's design system, several teams use the warning banner to advertise insurance upgrades despite a documented don't; how would you diagnose and fix it?

level: seniorimportance: should knowfreq 27%

basics

~20 s

Treat repeated misuse as evidence: check whether teams saw the don't when choosing, and what need drove them. Usually a promotion component is missing, so add a sanctioned alternative, restate the reason, surface guidance where designs start, then re-audit.

open as a page

In a design system that supports two major versions at once, how should its documentation be versioned, and why per major only?

level: middleimportance: nice to knowfreq 22%

basics

~20 s

Keep one docs version per supported major release, defaulting to the latest with a switcher and a notice on older pages. Under semantic versioning minors stay backward compatible, so per-major docs remain valid if additions are marked with their minor.

open as a page

In a design system, what is pattern-level usage guidance, and why can component pages alone not cover it?

level: middleimportance: nice to knowfreq 26%

basics

~20 s

Pattern-level guidance documents how components combine to solve a recurring user task, such as finding an available rental car. Component pages describe single parts; they cannot say how parts are arranged, which states the whole task needs, or when to vary it.

open as a page