Design Handoff and Developer Collaboration Questions
Getting a design built as intended: the specs, redlines and acceptance criteria a designer hands to engineers, and the communication that keeps the shipped build faithful to the design. Covers what a developer-facing spec must pin down, including component states, interaction and motion detail, breakpoint behavior, edge cases and error states, accessibility notes, and the design tokens an engineer will consume. Covers how the handoff is actually carried, in Figma Dev Mode, Storybook and the sprint ticket, and where those tools stop being enough. Also working with engineers before and during the build rather than only at the moment of handoff, resolving the tension when design intent meets technical reality, and design QA after the build: verifying the implementation against intent, visual regression checks in CI, and triaging drift without needlessly blocking a release. Both sides of the seam are examinable, including the engineer mapping design variants to component props and turning a spec into a typed component contract. Not design system and token architecture, versioning or governance; not building the prototype itself; not auditing an interface against accessibility standards.
Explain how you would map a Figma component that has multiple variant axes (size: small/medium/large, tone: primary/secondary, icon-position: none/left/right) to a React component API. Provide an example mapping table from Figma variant names to React props, discuss default prop decisions and call out ambiguous cases and how to resolve them.
Sample Answer
Direct answer
Treat each Figma variant property as one React (a widely used JavaScript library for building user interfaces) prop (a named input a component accepts), mapping variant values to prop values using the same vocabulary on both sides wherever nothing already contradicts it, and, where one side has an entrenched convention that differs, recording the translation explicitly in the mapping table instead of leaving each reader to rediscover it. Resolve any variant combination that has no clean one-to-one mapping by asking whether it should be a separate prop, a derived value, or actually disallowed as a state. Start from the simplest case before tackling a combinatorial one.
Structured elaboration
Easier entry point first: a two-axis button. A Button with size = {small, medium, large} and state = {default, disabled} maps directly: size becomes size: 'small' | 'medium' | 'large', identical vocabulary on both sides because nothing in this codebase says otherwise, and state=disabled collapses to a boolean disabled: boolean, since a two-valued "on/off" property is simpler as a boolean than as a string union. This is the pattern for most one- or two-axis components: an enum with more than two options becomes a string-union prop, and a two-valued property becomes a boolean.
Harder case: three axes. Size (small, medium, large), tone (primary, secondary), and icon-position (none, left, right).
| Figma variant property | Values | React prop | Prop type |
|---|---|---|---|
| size | small, medium, large | size | 'sm' | 'md' | 'lg' |
| tone | primary, secondary | tone | 'primary' | 'secondary' |
| icon-position | none, left, right | icon (presence) plus iconPosition | icon?: ReactNode, iconPosition?: 'left' | 'right' |
One deliberate deviation is visible in that table, and it is the kind that has to be written down rather than quietly absorbed: the Figma values read small, medium, large while the prop type is the abbreviated three-value union, because this codebase's existing components already ship those abbreviations and having one component disagree with the rest of the library is worse than the abbreviation itself. That is a recorded translation, not the default; the default is the identical vocabulary shown in the two-axis example above. Every translation costs a reader a lookup, so keep the count small, and never leave one implicit, which is the failure the table exists to prevent.
Default prop decisions: pick defaults matching the most common usage in the product, not the first value alphabetically. Here, size="md", tone="primary", no icon, because defaults define what happens when a developer forgets to pass a prop and should be the safe, common choice.
Ambiguous cases and how to resolve them: icon-position=none is not really a third value of the same axis as left and right, it is the absence of the icon prop entirely. Resolve it by splitting into two props (icon presence, and icon placement) rather than a three-value enum, since a single enum would still let a developer contradictorily set a position with no icon at all. Separately, the variant matrix generates every combination whether the product needs it or not: three sizes times two tones times three icon positions is eighteen frames, and some of them exist only because the matrix produced them. Pick a real one and call it out, for example size=small with icon-position=left or right, where the small button's height was drawn for a 16px icon while the icon set actually ships at 24px, so the combination renders in Figma but has no correct implementation. Note that a combination outside the declared axes, icons on both sides, say, is not this problem at all, it is a request for a fourth axis, and treating the two as the same thing is how an unplanned prop gets added mid-build. For the genuine in-matrix cases, either disallow them in code (a TypeScript type constraint, or a runtime development warning) or genuinely build them if a designer confirms the use case is real. Never leave the ambiguity silently unresolved; the mapping table above earns its keep by forcing that "does this combination actually exist" conversation before any code is written.
Trade-offs and pitfalls
Copying Figma's variant names verbatim into props can import vocabulary that does not fit the codebase's existing conventions (icon-position versus an already-established iconAlign); align names to whichever side already has a convention, not automatically to Figma's wording. Too many independent boolean or enum props create combinations that were never designed and can render broken states, so consider a discriminated union type (a TypeScript, a typed variant of JavaScript, pattern for mutually exclusive shapes) when combinations are truly exclusive. And resist mapping literally everything Figma exposes as a variant into a prop; a purely visual state like hover should usually live entirely in styling, never as an external prop at all.
Design an on-call or rapid-response process for high-severity visual regressions found in production after deployment. Define roles, triage steps, temporary workarounds, rollback criteria, and post-mortem actions to prevent recurrence.
Sample Answer
Direct answer
For a high-severity visual regression in production, the process needs a named on-call pair (design and engineering) who can classify severity fast, apply the safest available workaround within minutes rather than hours, and only roll back when a small set of pre-agreed criteria are met, since deciding rollback criteria in the middle of an incident under pressure tends to produce worse decisions than deciding them in advance.
Roles
- Design lead (on-call): assesses whether the regression is a real usability or brand problem versus cosmetic, and proposes the fastest safe visual fix.
- Frontend engineer (on-call): implements the actual fix, whether that's a scoped CSS override, a revert, or a feature-flag toggle (a feature flag being a switch that turns a piece of functionality on or off without a new deploy). From the engineering side, the fastest and safest default is usually reverting the specific change or flipping a flag back, rather than hand-patching a fix live, since a live patch under time pressure is itself a common source of a second incident.
- Release or platform engineer: executes the rollback or flag flip and watches the relevant metrics afterward.
- QA: verifies the fix actually resolves the issue across the affected browsers and devices before the incident is closed.
- PM or support lead: communicates status to anyone who needs to know, so the on-call pair isn't also fielding status questions mid-fix.
Triage steps
- Classify severity: does this block a core flow (checkout, login, sign-up) or is it cosmetic-only? Confirm with a screenshot and, if possible, an estimate of how many users are affected.
- Reproduce and scope: which browsers, devices, and screen sizes show the problem, and which recent commit or deploy touched the relevant styles or components.
- Decide the fastest safe mitigation given the scope: a small CSS override, a feature flag flip, or a full rollback.
Temporary workarounds
A scoped CSS override shipped as a quick hotfix to restore readability or layout without touching the underlying logic; toggling a feature flag back to the previous version if the regressed feature is behind one; or swapping a specific broken asset for a known-good fallback.
Rollback criteria
Roll back the deploy outright if a core flow is blocked, if there's no safe hotfix available within a short window (for example 30 to 60 minutes), or if an attempted hotfix itself fails verification or introduces a new problem. Cosmetic-only issues on non-critical pages generally don't justify a full rollback; a scoped fix and a follow-up ticket is proportionate instead.
Post-mortem actions
Trace the regression to the specific commit and the design-token or style change involved, revert or correct it properly (not just patch around it), and add the specific gap that let it reach production (most often, no visual regression test existed for that component) to a follow-up ticket. I'd track two clock metrics afterward: time to acknowledge (how long from the alert firing to someone picking it up) and time to recover (how long from the alert to the issue actually being resolved), since those numbers tell you whether the on-call process itself is working, separately from whether the underlying bug rate is improving.
Worked example
A CSS deploy accidentally sets a checkout button's text color to white on a white background, but only on mobile Safari, because of a browser-specific rendering quirk in the affected style. Triage classifies this as high severity (it blocks the core checkout flow on a specific but non-trivial share of traffic) within minutes of the first report. Scoping shows it's isolated to one recent commit that touched a shared button style. Since the fix would need to be verified across several Safari versions and there's no confidence a scoped CSS override wouldn't miss an edge case, the on-call pair rolls back that specific commit rather than attempting a live patch, restoring the previous, known-good button style immediately. The post-mortem action is adding a mobile Safari-specific visual regression test for that shared button component, since none existed.
Trade-offs and pitfalls
Paging a design on-call rotation for every visual issue, including trivial cosmetic ones, causes alert fatigue and burns out the rotation; the severity classification step exists specifically to prevent that. The opposite failure is under-reacting: treating a checkout-blocking regression as "we'll fix it in the next release" because it's "just visual" ignores that a visual bug can be just as revenue-blocking as a functional one.
Design a machine-readable JSON schema for UI component specifications intended to be generated from design tool exports and consumed by code generators and Storybook. Define required fields (id, displayName, variants, props, tokens, breakpoints, accessibility metadata) and provide a compact example JSON for a Button component illustrating key fields.
Sample Answer
Approach
A component spec generated from a design tool export needs to be complete enough that a code generator can scaffold a real component and Storybook (a tool for building and documenting UI components in isolation) can render every variant, without a human filling in gaps by hand. The fields below cover identity, the visual surface (variants), the programmatic surface (props), the design-token dependencies, responsive behavior, and accessibility, since a spec missing any one of those forces a human back into the loop for exactly the part automation was supposed to remove.
Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "ComponentSpec",
"type": "object",
"properties": {
"id": { "type": "string", "description": "Stable identifier, e.g. the design tool's component key. Never regenerated on rename." },
"displayName": { "type": "string", "description": "Human-readable name shown in Storybook and generated docs." },
"variants": {
"type": "array",
"items": { "type": "string" },
"minItems": 1,
"description": "Named visual variants, e.g. primary/secondary/destructive."
},
"props": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"type": { "type": "string" },
"enumValues": { "type": "array", "items": { "type": "string" } },
"required": { "type": "boolean" },
"default": {}
},
"required": ["name", "type", "required"],
"additionalProperties": false
}
},
"tokens": { "type": "array", "items": { "type": "string" }, "description": "Design tokens consumed, by name, not raw value." },
"breakpoints": {
"type": "object",
"description": "Behavior that changes per breakpoint, keyed by breakpoint name. Every field a generator can act on is typed; free prose is confined to 'note'.",
"additionalProperties": {
"type": "object",
"properties": {
"layout": { "type": "string", "enum": ["fullWidth", "intrinsic", "fixed"] },
"hidden": { "type": "boolean", "default": false },
"tokenOverrides": {
"type": "object",
"additionalProperties": { "type": "string" },
"description": "Token name to token name, e.g. {\"spacing-4\": \"spacing-2\"}. Values are token names, never raw values."
},
"minTouchTarget": { "type": "string", "description": "e.g. '44x44px'. Omit where the platform default applies." },
"note": { "type": "string", "description": "Human-only detail with no typed field yet. Generators must ignore it." }
},
"additionalProperties": false
}
},
"accessibility": {
"type": "object",
"properties": {
"role": { "type": "string" },
"requiresAccessibleName": { "type": "boolean" },
"keyboardInteraction": { "type": "array", "items": { "type": "string" } }
},
"required": ["role", "requiresAccessibleName"],
"additionalProperties": false
}
},
"required": ["id", "displayName", "variants", "props", "tokens", "breakpoints", "accessibility"],
"additionalProperties": false
}
Example: Button
{
"id": "cmp_button_01",
"displayName": "Button",
"variants": ["primary", "secondary", "destructive"],
"props": [
{ "name": "label", "type": "string", "required": true },
{ "name": "variant", "type": "enum", "enumValues": ["primary", "secondary", "destructive"], "required": false, "default": "primary" },
{ "name": "disabled", "type": "boolean", "required": false, "default": false },
{ "name": "onClick", "type": "function", "required": true }
],
"tokens": ["color-primary", "color-neutral-100", "spacing-4", "radius-2", "font-size-base"],
"breakpoints": {
"mobile": { "layout": "fullWidth", "minTouchTarget": "44x44px", "tokenOverrides": { "spacing-4": "spacing-3" } },
"desktop": { "layout": "intrinsic" }
},
"accessibility": {
"role": "button",
"requiresAccessibleName": true,
"keyboardInteraction": ["Enter: activates", "Space: activates"]
}
}
(Validated against the schema above with a JSON Schema validator before shipping.)
Key fields, why each earns its place
idversusdisplayName:idnever changes even if a designer renames the component in the design tool, so generated code and Storybook stories that referenceiddon't silently break on a rename;displayNameis purely presentational.variantsis a flat list of names, not full style definitions, because the actual visual values live behindtokens; a code generator maps each variant to the token set it uses, keeping the spec from duplicating the design system's own source of truth.propsmirrors what a component's actual API needs: name, type, whether it's required, and a default, which is exactly the information a code generator needs to scaffold a typed interface and exactly what Storybook needs to build its interactive controls panel.accessibility.requiresAccessibleNameis a boolean a generator can act on directly: if true and no accessible-name-producing prop (likelabeloraria-label) is wired up, the generated component should fail a lint check rather than ship silently unlabeled.breakpoints.tokenOverridesmaps a token name to another token name rather than to a raw value. A responsive rule written as{"padding": "8px"}would reintroduce exactly the hardcoded value thattokensexists to eliminate, and it would do it in the one place nobody thinks to audit; forcing both sides of the mapping to be token names keeps the responsive behavior inside the design system's own source of truth.
Edge cases
- A prop with
type: "enum"but noenumValuessupplied is a malformed spec the JSON Schema alone won't catch, since a plain string type is valid whether or notenumValuesaccompanies it; a code generator needs an extra validation pass beyond schema validation for cross-field rules like this. breakpointsis typed rather than free-form, and resisting the pull to leave it open is the whole test of whether this schema is actually machine-readable. The tempting move is to argue that breakpoint overrides vary too much by component to standardize and let the object hold anything. But a code generator can do precisely nothing with{"note": "Full width; minimum touch target 44x44px."}, so the one loose field becomes the one that puts a human back in the loop, which is the outcome the whole spec exists to remove. Typing the four cases that actually recur across a component library (layout mode, visibility, token substitution, touch target) covers the common path, andnotesurvives as a labelled escape hatch generators are explicitly told to ignore. When a genuinely new kind of override shows up, the correct response is to add a typed field for it and watchnoteshrink, not to widen the schema back to prose.- A component that composes other components, a Card containing a Button, isn't represented by this schema as written; extending it to reference other
ComponentSpecidentifiers under a newcomposedOffield would be the natural next step, but is out of scope for a single component's own contract.
Given the following design tokens, write a sample CSS variables file (custom properties) that maps them for use on the web. Tokens: primary-color = #0a84ff, neutral-100 = #ffffff, spacing-4 = 16, font-base = 'Inter', 16px. Provide the CSS variable names and example usage for a button.
Sample Answer
Approach
Each token becomes one CSS custom property (a variable declared with --name and read with var(--name)), scoped on :root so it's available everywhere. Two of the given tokens need a small decision the raw values don't make for you: spacing-4 = 16 has no unit, and font-base = 'Inter', 16px actually bundles two different CSS concerns, font family and font size, that CSS itself keeps as separate properties.
CSS variables file
:root {
--color-primary: #0a84ff;
--color-neutral-100: #ffffff;
/* spacing-4 given as the unitless number 16; expressed in rem (16px
assuming the default 16px root font size) rather than px, so spacing
still scales if a user or browser changes their base font size */
--spacing-4: 1rem;
/* font-base split into its two real CSS properties. The 16px size
converts to rem on exactly the same reasoning as the spacing token:
a user who raises their browser's base font size is asking for
larger text, and a hardcoded 16px here would silently ignore that. */
--font-family-base: 'Inter', sans-serif;
--font-size-base: 1rem;
}
.button {
background-color: var(--color-primary);
color: var(--color-neutral-100);
padding: var(--spacing-4);
font-family: var(--font-family-base);
font-size: var(--font-size-base);
}
Key points
--color-primaryand--color-neutral-100map directly, one token, one variable, no unit ambiguity for colors.--spacing-4converts 16 (unitless in the token) to1rem, since 16px divided by the browser default 16px root size is exactly 1rem; using rem here means spacing keeps its relative proportion if a user increases their browser's base font size for readability, which a hardcoded16pxwould not.font-baseisn't one CSS property's value,font-familyandfont-sizeare genuinely separate CSS properties, so it becomes two variables rather than one. A CSSfontshorthand property does exist and can combine both (font: 1rem 'Inter', sans-serif), but splitting them keeps each independently overridable, useful the moment a component needs the same family at a different size.- The rem conversion has to apply to
--font-size-basetoo, not just--spacing-4, and this is the detail most often gotten half-right. If spacing scaled with the user's base font size while type stayed pinned at 16px, a reader who doubled their browser's base size would get a button whose label is still 16px sitting inside twice as much padding, which is a worse result than either choice made consistently. Pick one basis and enforce it in the token file, because a component author deciding px or rem property by property is precisely how a token system drifts back into hardcoded values. sans-serifis added as a fallback after'Inter'so text still renders reasonably if the font hasn't loaded yet or fails to load.
Edge cases
- A component needing a color the token list doesn't define yet (a hover or disabled state) shouldn't invent a new hardcoded hex value inline; that's exactly the drift a token system exists to prevent, so it should be flagged back to design as a missing token rather than improvised in code.
- If the design system later needs dark mode, these same variable names get redefined inside a
[data-theme="dark"]selector rather than renamed, so components referencingvar(--color-primary)don't need to change at all when the theme changes. - Because
--spacing-4and--font-size-baseare both expressed in rem, a component that genuinely needs a value that must NOT scale with the user's font-size setting (rare, but real for something like a fixed hairline border width, or an icon that has to align to a device pixel grid) should not reuse them; that's a deliberate exception, and it should be written as its own px-valued token rather than a raw px value inlined in the component, so the exception stays visible and countable.
Propose how to integrate visual regression testing into the CI/CD pipeline to catch accidental visual changes from developer merges. Include tooling options (e.g., Percy, Chromatic, Backstop), how to write Storybook stories to enable comparisons, and the designer's role in triaging diffs.
Sample Answer
Direct answer
I'd wire visual regression testing (automated screenshot comparison that catches unintended pixel-level changes) into the pipeline so every pull request (PR, the mechanism engineers use to propose a code change for review before it's merged) builds Storybook (a tool that renders each UI component in isolation, outside the full app, so it can be viewed and tested on its own), runs the diff tool against a saved baseline, and posts the result directly on the PR, with the designer as the final approver of any flagged visual change rather than a blocker on every merge.
Tooling options
| Tool | Model | Best fit |
|---|---|---|
| Percy | Hosted, cloud-run diffing with a built-in review UI | Teams that want PR comments and a review workflow with minimal setup |
| Chromatic | Hosted, built specifically around Storybook | Teams already standardized on Storybook who want tight integration |
| BackstopJS | Self-hosted, open source | Teams needing full control over infrastructure or with data that can't leave their own environment |
For unusual interactions that a snapshot alone can't capture (multi-step flows, hover states triggered by script), a programmable option like Playwright combined with a pixel-comparison library gives per-test control at the cost of more setup work.
Writing Storybook stories for comparison
- Each meaningful state gets its own story (a single saved, named view of a component in one specific state, the basic unit Storybook renders and the diff tool compares): default, hover, focus, disabled, error, and key responsive widths, so the diff tool has something specific to compare rather than one generic view of the component.
- Story data must be deterministic (fixed mock props, not live or randomized data), because a snapshot that changes on every run for reasons unrelated to the actual code change trains the team to distrust the tool.
- Stories should include realistic content edge cases, like a long label or an RTL (right-to-left) variant, as separate stories, since those are exactly the states most likely to break silently.
- A consistent naming convention like
component--state--viewportmakes it easy to tell at a glance which specific case failed.
CI/CD integration
CI/CD (continuous integration and continuous deployment, the automated pipeline that builds and tests every code change) builds the Storybook bundle for the PR's branch, the visual tool captures screenshots of every story, compares them to the baseline, and if any diff exceeds the configured threshold, posts a comment on the PR with the before/after images and sets the check to failing.
The designer's role in triaging diffs
The designer reviews flagged diffs in the tool's comparison view, not the raw code, and for each one either approves it (which updates the baseline, meaning the change is treated as the new correct state going forward) or rejects it with a note pointing at what looks wrong and why, tagging the engineer to fix it. This keeps the designer as the domain expert on "is this visually correct" without requiring them to read the diff's underlying code.
Worked example
A PR changes a design token so a card component's border-radius token value moves from 4px to 8px. CI builds Storybook and the Card--default--desktop story comes back changed, but the size of that change is the part to work out before setting any threshold on it. A corner-radius change repaints only the four corner arcs: each corner changes by r squared minus a quarter of pi r squared, about 3.4 square pixels at 4px against 13.7 at 8px, so roughly 10.3 per corner and about 41 pixels in total. On a 320 by 200 story that is 0.06% of the image, below every percentage default in common use (BackstopJS, for instance, ships a 0.1% mismatch default) and nowhere near a round number like 1 or 2%. That is the trap worth naming: a percentage-of-image gate cannot see a corner-radius change on a component story at all, and a team that sets one loosely will conclude the tool is working precisely because it never fires. So for component-level stories the gate is set in absolute changed pixels instead, say fail above 20, and percentages are kept for full-page snapshots, where the canvas is large and the defects worth catching are correspondingly large. With the gate written that way, 41 changed pixels fails the check and a comment appears on the PR with both screenshots. The designer opens it: if the radius change was an intentional, already-approved design system update, they approve the new screenshot as the baseline, unblocking the merge; if the engineer applied the wrong token by mistake, the designer rejects it with a comment naming the correct token, and the PR stays blocked until the fix is pushed and the check reruns clean.
Trade-offs and pitfalls
Hosted tools like Percy and Chromatic are the fastest to set up but bill per snapshot, so covering every prop combination on every component can get expensive quickly; a self-hosted option like BackstopJS avoids that cost but needs someone to maintain the infrastructure. The most common pitfall is capturing too many stories: broad coverage sounds safer, but every extra story is a chance for an unrelated flaky diff (a font rendering difference between CI runners, for instance) to slow the pipeline and erode trust in the gate, so it's worth being selective about which states genuinely need automated coverage versus manual spot-checks.
Unlock Full Question Bank
Get access to all 28 Design Handoff and Developer Collaboration interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.