← Back to LabDebora’s Lab / Publication

How I made Storybook the source of truth — not Figma.

A code-first workflow where component APIs, states, accessibility and documentation live next to what actually ships.

Written from practice↓ Read the field note
[ 00 / Premise ]

For a while I treated Figma as the place where the design system had to be recreated and maintained. I changed my position when the coded component became the more reliable description of what had actually shipped.

[ 01 / 04 ]

The problem was not documentation

Design and Engineering were reviewing two representations of the same component. Names, defaults and edge cases could drift even when everybody was acting in good faith.

A handoff document could explain intent, but it could not guarantee that the state being discussed still matched the public API in code.

[ 02 / 04 ]

Put the contract next to the implementation

I used Storybook to bring foundations, real React components, documentation and behavioural states into one inspectable place. TypeScript props described the public options; stories made those options visible.

A designer could review intent and states. An engineer could inspect the API and implementation without translating a separate specification.

[ 03 / 04 ]

What belongs in the source of truth

A useful story should expose the decisions a consumer needs, not every internal implementation detail.

  1. Supported props, defaults and variants.
  2. Empty, loading, error and permission states.
  3. Keyboard behaviour and accessible naming.
  4. Token references and usage guidance.
  5. Known constraints and decisions that still need review.
[ 04 / 04 ]

What Figma still does better

I still use Figma to explore composition, compare directions and communicate before implementation. Code-first does not mean code-only.

The boundary is simple: Figma helps us decide what might exist. Storybook shows what the team can actually use.

[ Technical evidence ]

One contract, followed from code to behaviour.

The evidence is not three versions of the component. It is one decision moving through the system: TypeScript defines the API, Storybook makes it controllable and the stories expose the supported results.

01 / TypeScript contract

The public options start in code.

The union type and component interface make tone, selection, icon behaviour and label explicit. Defaults and rendered attributes are inspectable in the same implementation.

TypeScript implementation of the Tag component showing its tone union, public props and rendered data attributes.
02 / Interactive documentation

The same API becomes visible and testable.

The rendered component, property types, defaults and controls stay together. The team can change an option and inspect the result without translating a separate specification.

Real Storybook documentation for the Tag component showing its rendered state, typed properties, defaults and interactive controls.
03 / Rendered states

Supported variations are shown, not implied.

Tones, selected treatments and the version without an icon are documented as real outputs. Consumers can see the intended boundaries before introducing another local variant.

Storybook component variations showing Tag tones, selected treatments and variants without an icon.
[ Open materials ]

What you can reuse.

Not just a conclusion: these are the working artefacts behind the argument. Open them, question them and adapt what is useful.

01

Typed public API

The Tag contract, defaults and rendered attributes in the shipped React component.

Read Tag.tsx
02

Inspectable stories

The examples that turn supported states into reviewable behaviour.

Read Tag stories
03

Live documentation

The component API and its rendered output in the published Storybook.

Open Tag docs