Chapter 03 · 8 min read

Documentation practices

Treat documentation as the readable surface of the system: close to the code, grounded in design intent and structured so people and AI can use it.


Move the source of truth as the team matures

Many design systems begin with detailed component specifications in Figma. At the outset, that can be a sensible contract: designers describe anatomy, variants, states and tokens, then engineers translate the specification into production components.

The working relationship changed the documentation model. Designers gained access to VS Code and GitHub, began with small token changes and, as their capability and AI tooling improved, contributed more substantial component and documentation changes. The separate Figma specification eventually became stale because the production decisions were happening elsewhere.

  1. 01
    Specify in Figma

    Detailed component specifications give engineering a clear starting contract.

  2. 02
    Implement together

    Design and engineering resolve behaviour, tokens and exceptions collaboratively.

  3. 03
    Contribute in the repository

    Designers make reviewed changes to tokens, components and guidance alongside engineers.

  4. 04
    Publish from Storybook

    Executable examples and guidance live beside the code that consumers install.

  5. 05
    Expose a machine-readable contract

    Structured intent helps AI tools inspect, generate and validate without guessing.

Put component guidance beside the component

Figma remains valuable for visual exploration, composition and design review. It should not duplicate a complete component manual if the team cannot keep that manual synchronised with production.

Storybook can become the practical source when the main audience is engineers. Its MDX pages combine written guidance with live examples, Figma references, accessibility guidance and changelogs. Adjacent stories define controls, variants and interaction tests. This makes the documentation inspectable and testable instead of a static handoff artefact.

FigmaDesign intent

Composition, anatomy, visual exploration and review.

StorybookLiving guidance

Usage, examples, states, accessibility and implementation.

RepositoryProduction truth

Tokens, APIs, tests, version history and ownership.

Use one repeatable page contract

A component page should answer design and implementation questions in a predictable order. Nathan Curtis describes strong component documentation as content architecture for several audiences, not merely a generated property table. Storybook Autodocs is a useful baseline; the human guidance is what turns it into a design-system page.

01
Purpose and decision

What problem it solves, when to use it and when not to use it.

02
Live default and variants

A working example first, then meaningful sizes, states and combinations.

03
Anatomy and content

Named parts, required content, labels, constraints and composition rules.

04
Behaviour and accessibility

Keyboard operation, focus, announcements, validation and responsive behaviour.

05
Implementation contract

Props, events, token mappings, dependencies, framework notes and code examples.

06
Status and maintenance

Owner, maturity, package version, changelog and last review date.

Use progressive disclosure for different readers. Product owners, product managers and business analysts need the purpose and constraints quickly. Designers need anatomy and composition. Engineers need executable examples, APIs and dependency notes. One canonical page can serve all of them without giving every audience the same level of detail at once.

Document the decisions the system adds

Do not rebuild every control from first principles when an established framework already provides dependable behaviour. For icare, the practical starting point is its existing Bootstrap implementations: document the supported versions, apply shared tokens and styling contracts, and be explicit about what the design system adds or overrides.

iCare largely uses Bootstrap, with different Bootstrap versions maintained across different products and codebases. Documentation must therefore identify the product and Bootstrap version an example applies to. It should distinguish the common iCare design decision from the version-specific markup, utilities and behaviour used to implement it.

Inherited from the library

Core interaction, accessibility primitives, event model and framework integration.

Owned by the design system

Semantic tokens, visual states, approved variants, wrapper APIs, composition rules and exceptions.

Verified by the team

Keyboard behaviour, token application, visual regression, supported versions and upgrade impact.

Each page should explain what comes from Bootstrap, what iCare has mapped or overridden, and where a product implementation intentionally differs. Consumers should never have to reverse-engineer whether a behaviour belongs to Bootstrap, the design system or the product.

Describe intent in a tool-neutral form

Figma data describes how Figma stores a design. Framework code describes how one implementation renders it. Neither is a neutral description of what the component means. The Missing Language of User Interfaces makes the case for an intermediate representation: structured enough for software to parse, but readable enough for a designer and engineer to review together.

YAML can be a convenient authoring format, but YAML itself is not the goal. The goal is a stable schema for intent: component anatomy, relationships, variants, states, token roles, accessibility expectations and implementation mappings. Tokens should use the established Design Tokens Community Group JSON format for exchange; a component specification can reference those tokens without inventing another colour system.

01
Represent intent, not storage

An accurate export of Figma layers can still miss why padding exists, which relationships matter and what may change.

02
Separate what from how

Describe identity, anatomy and relationships independently from visual styling and platform implementation.

03
Make relationships explicit

Props alone are not enough. Capture hierarchy, slots, composition, states and the rules connecting them.

04
Keep it compact and deterministic

Remove tool noise so people and AI can inspect the complete contract without repeatedly interpreting raw files.

05
Design for legible failure

A reviewer should be able to see what was dropped, distorted or invented before generated output reaches production.

06
Aim for translation in both directions

A durable representation could eventually inform Bootstrap implementations, Storybook guidance and design assets without making one of them the master format.

The article uses Layla, a compact layout language, to explore this approach. It is a useful prototype rather than an established standard. Its most transferable lesson is the workflow: translate design into a reviewable intermediate form, have a human verify the intent, then let AI or deterministic tools generate platform-specific output.

component: icare-button
intent: Trigger an immediate action
anatomy:
  - leadingIcon: optional
  - label: required
variants: [primary, secondary, tertiary]
states: [default, hover, focus, disabled, loading]
tokens:
  background: "{colour.background.interactive}"
  label: "{colour.text.on-interactive}"
accessibility:
  element: button
  keyboard: [Enter, Space]
implementation:
  base: Bootstrap
  versionPolicy: product-owned
  systemClass: icare-button

Let AI accelerate contribution, not invent the rules

AI can lower the barrier for designers to work in the repository, generate first-pass stories and translate a reviewed contract across frameworks. It also amplifies ambiguity. A machine-readable document that omits relationships or intent is still an incomplete specification.

  1. 1Capture intent

    Agree the design decision and structured component contract.

  2. 2Human review

    Designer and engineer resolve semantics, dependencies and exceptions.

  3. 3Generate

    Use AI for stories, prose, mappings and framework-specific scaffolding.

  4. 4Verify

    Run interaction, accessibility, token and visual tests.

  5. 5Publish together

    Merge code, stories, guidance and changelog in one reviewed change.

The documentation is not a second product beside the system. It is the human-readable and machine-readable surface of the system itself.

Make the next version deliberately small

  • Agree a Storybook page template and apply it to one high-use component.
  • Mark old Figma component specifications as archived rather than maintained guidance.
  • Inventory the Bootstrap version used by each product and publish a maintained compatibility matrix.
  • Record Bootstrap dependencies, iCare overrides and version-specific implementation notes on each component page.
  • Publish tokens in the Design Tokens Community Group format and reference them from component documentation.
  • Pilot one reviewed, machine-readable component contract before designing a schema for the whole library.
  • Require documentation, tests and changelog updates in the same pull request as a component change.
The Missing Language of User InterfacesThe Design Systems Journal on a human-readable intermediate language between design and code. Spec-Driven UI Component DevelopmentNathan Curtis on structured design intent spanning Figma, code, documentation and AI. Component Contracts and SchemasNathan Curtis on typed, platform-independent and verifiable component contracts. Storybook MDXOfficial guidance for combining stories, prose and interactive documentation. Design Tokens Format ModuleThe tool-neutral W3C Community Group exchange format for design tokens. DESIGN.mdAn emerging format for giving coding agents structured visual-system context.
04 · Adoption and change managementMake the system the path of least resistance, not a mandate.