Skip to content

Design-in-code

Playground-driven design, specifying every state in code before the API hookup

The playground is a design artifact that lives inside the codebase, not next to it. Neither disposable prototyping nor generated design-to-code: design-in-code. The designer sees every screen in all its states (default, loading, empty, error, success) within seconds, without a backend, and produces the real code the developer will later hook up to the API. The value is not the prototype, it is the interface contract: every state is specified before the developer writes the integration.

Demonstration

Every state, one click away

The same screen, in each of its states. This is what the designer handles locally, with no backend. Showing rather than describing, because that is the method's own principle.

Studio Nord

Lille, France

Profil complet

Agence partenaire depuis 2019. Trois certifications actives, douze projets référencés.

Problem addressed

In most product organizations, design lives next to the code: mockups, clickable prototypes, specs. The handoff from design to development is a translation, and every translation loses information. Even when a rigorous discovery specifies every state, the mockup remains a static representation: transitions and micro-interactions get approximated there, and the developer re-implements it in another language. The mockup and the code become two sources of truth that drift apart. The cost does not show up at handoff, it shows up three weeks later as rework.

Le design à côté du code

Le handoff reste une traduction

  1. Même complète, la spec reste une représentation statique.
  2. Le développeur la ré-implémente : transitions et micro-interactions s'approximent.
  3. Deux sources de vérité, la maquette et le code, divergent avec le temps.

États dessinés, à retraduire en code

défaut chargement vide erreur succès

Le coût n'apparaît pas au handoff. Il revient en retravail quand la traduction dérive.

Le design dans le code

La vue rendue est la spec

  1. Les états ne sont pas dessinés, ils sont implémentés et tournent.
  2. La vue du playground est celle qui part en prod : données, tokens, responsive réels.
  3. Une seule source de vérité. Le développeur branche l'API, il ne retraduit rien.

États exécutés, prêts pour le branchement

défaut chargement vide erreur succès

Le moment où la maquette et le code divergeaient disparaît.

Steps

The method in 4 steps

  1. Step 1

    Observe the real product

    Point the local environment to a preproduction, navigate the existing product, understand the page structure, the interface patterns and the naming. Identify the two or three most structuring data areas to simulate first. No building blind: we start from what exists, not from a blank page.

  2. Step 2

    Simulate the data layer

    Create a fake-data mode on the identified areas, upstream of the API client. Screens read their data from an intermediate store that can be fed without touching the backend. Every future hookup point is marked explicitly, so the developer knows where the API will plug in.

  3. Step 3

    Implement every state before the hookup

    Put a switcher on each screen that toggles between default, loading, empty, error and success, and implement the real rendering of each one. This is the step that produces the contract: the developer no longer has to re-implement the states from a static representation, they are already there, executed and validated. The visual work moves forward independently of the API, a decoupling in time.

  4. Step 4

    Industrialize and hand over

    Document the conventions folder by folder, formalize the recurring actions, support the first applications on the development side and on the product side. Formalization is not an end-of-project deliverable, it is what lets the method survive its author's departure and makes a new person productive fast.

Success conditions

What tells you it works

Contraindications

When not to use it

Applied examples

Where the method has lived

Diagnostic

Run your own diagnostic

Before rolling the method out, better to know where your squad stands. Answer the six conditions, the score updates live. The playground is the result when the score allows it, not a deliverable to copy as is.

  • 01 Front/back decoupling Fondation

    Can the front end start with a single command, without spinning up the backend?

    Front/back decoupling
  • 02 Mockable data layer Fondation

    Do components read from an intermediate store, or directly from the API client?

    Mockable data layer
  • 03 Design system usable in code

    Does a documented component library exist that can be imported?

    Design system usable in code
  • 04 Compatible Git workflow

    Can a branch space be dedicated to design, with its own rules?

    Compatible Git workflow
  • 05 Automated preview environment

    Do branches deploy a preview visible to product and development, by URL?

    Automated preview environment
  • 06 Technical point of contact

    Who do we call when it does not compile?

    Technical point of contact

Conditions réunies

0/6

Réponds aux six conditions, la lecture du score s'affiche ici.

Going further

An interface contract, not a prototype

The most frequent confusion is filing the playground with the prototyping tools. It is the opposite. A prototype exists to validate an intention and then be thrown away. The playground produces the real product code, the code the developer will hook up, not a representation that will need to be retranslated.

The distinction with design-to-code matters just as much. Design-to-code generates code from a mockup, with the classic risk of generated code drifting away from the codebase. Playground-driven design works directly inside the codebase: it is design-in-code. What the designer sees in the playground is exactly what will ship to production, because it is the real view rendering, not a copy.

What creates the value is therefore not prototyping speed, it is the contract: when the developer opens the screen to hook up the API, every state is already implemented and validated in the real view. The usual moment where they re-implement those states from a static mockup, and where the gap gets settled case by case with design, disappears.

This method was born during the rebuild of the PrestaShop Expert Portal. The strategic case study explains why the organization decided to leave the existing tool; the operating case study explains how a squad of three delivered it; the playground formalizes how design could move forward inside the product without waiting for every backend integration.

The front-end design cycle

The cycle follows the same pipeline as development, but moves design iteration into the real rendering.

Framed intent: name the need, the goal of the screen, the design-system constraints and the expected states before generating.

AI proposal: produce a first version using existing components, concrete enough to evaluate, never treated as final.

Vibe design: react to the real rendering, adjust hierarchy, density, rhythm, clarity and i18n on the screen that will be hooked up.

Arbitration and validation: decide when the screen is right, then send it back through the common flow: review, commit, PR, preproduction and production.

Design does not disappear. The medium changes: the discussion no longer happens on a representation, it happens on the interface as it becomes the product.

The sovereignty rule

The method rests on one rule that protects both crafts: the designer never touches backend logic or API calls, the developer never rebuilds the visuals from scratch. Each one works on their own layer.

This decoupling is first of all temporal. The visuals and all their states move forward while the API does not exist yet, then the hookup lands on a structure that is already complete. This is not design taking power over engineering, it is a reorganization of the order in which things get decided. Naming this rule explicitly avoids the most expensive misunderstanding, the one that would read the method as an intrusion rather than a better-sequenced collaboration.

The conditions that make the method viable

The trap would be to promise an identical replication everywhere. The intent and the grid are portable, the implementation stays specific to each stack. Before deploying the method, better to diagnose six conditions, which come down to the squad’s practices more than to chance. They are what the diagnostic above asks you to evaluate one by one.

The first two are foundations: if front/back decoupling or the mockable layer is missing, the playground is not the first project to run. The others are accelerators. The automated preview condition is often the one that is missing, and it is not blocking: the playground runs locally without it, it only serves to make the rendering visible without pulling the branch.

Laying these six conditions out as a grid to fill in transforms the conversation. We do not promise a method that would break on a non-decoupled stack, and we do not get the method rejected when the real blocker is an infrastructure condition that can be named and budgeted.

Sell the grid, not the tool

Three principles help defend the method beyond its first application.

Auditing before asking changes the nature of the request. We do not show up demanding access, we show up with a reading of the code and an informed collaboration proposal. Then, show before arguing: a five-minute demo of the playground weighs more than a three-page document with checkboxes. The order that works goes from the demo to the leadership one-pager, then to wider circulation.

The most structuring point is the last one: what lands on the table with every new squad is the readiness grid, not the playground. The playground is the outcome when the score allows it, the grid is the entry point of the discussion. This shift protects against the two symmetrical failures, promising a replication that shatters, or getting the method rejected for a reason that had never been named.

Maturity
consolidated
Tags
design-engineering · design-systems · design-to-code · workflow
Last updated

Written with terquedad colombiana, in the south of France.

Not with love, with context and a patient agent.

Still learning.

© 2026 All rights reserved.