Sudarshan K M

Sudarshan K M 👋

A Passionate Frontend Developer 🖥️ focused on UI/UX Design & Pixel-Perfect Experiences, exploring Backend Development and building modern web applications.

Figma design file on one monitor and the matching React code on another

My Figma to React and Next.js Workflow, Step by Step

A Figma file is a promise. It describes how something should look and feel, but it is not yet a website. Turning that promise into working code is a craft of its own, and the quality of the result depends heavily on the process in between. Here is the workflow I follow when I convert a design to React or Next.js.

Step 1: Audit the design before writing code

I open the file and read it end to end before touching an editor. I am looking for the pages and states that exist, the repeated patterns, and anything that is missing. Typical gaps I look for are mobile layouts, hover and focus states, empty states, form validation messages and how long text should behave.

If something is missing, I write the questions down and ask the designer or client now. A two minute answer at this stage saves hours of rework later.

Step 2: Extract design tokens

Tokens are the named values that make a design consistent: colours, font sizes, line heights, spacing, radii and shadows. I collect them from the file and put them in CSS variables so there is one source of truth.

:root {
  --primary: #4770ff;
  --text: #1a1f2c;
  --radius: 8px;
  --space-3: 24px;
}

With Bootstrap, I override its Sass or CSS variables to match the design instead of piling extra rules on top. That keeps the stylesheet small and predictable.

Step 3: Make a component inventory

Next I list the pieces that repeat: buttons, cards, navigation, form fields, section headings, footers. Each becomes a component. This is where React earns its place, because a card defined once is used everywhere and cannot drift out of sync.

I organise code by feature, so a page lives in its own feature folder with its components next to it, and anything reused across pages goes into a shared folder. It is the same structure used in this portfolio.

Step 4: Build static markup first

I start with clean, semantic HTML structure and styling, before adding behaviour. Headings are in the right order, links are links and buttons are buttons. This is good for accessibility and for search engines, and it makes the layout easier to reason about.

Step 5: Add responsiveness deliberately

I build for the smallest screen first and add rules as the layout has room to grow, or I work from the supplied breakpoints when the design includes them. For images I use correct sizes and for text I check wrapping. I write about this in more detail in my responsive web design best practices guide.

Step 6: Handle interaction and states

Once the structure is right, I add the behaviour: menus, accordions, sliders, modals, theme switching and form handling. I prefer well maintained libraries where they save effort and avoid adding heavy dependencies for small features. Every interactive element gets hover, focus and active styling, because keyboard users depend on visible focus.

Step 7: Connect data if needed

If the site pulls content from an API or a CMS, I connect it after the layout is solid. I handle the three states that always exist: loading, success and error. In Next.js, content that does not change often can be generated ahead of time, which keeps pages fast.

Step 8: Compare against the design

This is the review step that separates a good build from an accurate one. I place the design and the page side by side at the same width, check spacing and type with the developer tools, and test with real content. It is the same approach I describe in pixel perfect web design.

Step 9: Check performance and accessibility

Before handover I check image sizes, font loading, colour contrast and keyboard navigation. Google's Core Web Vitals give useful targets, and the WCAG guidelines are a good accessibility reference.

What makes the handoff easier for everyone

  • Name layers and frames clearly and use Figma styles and components.
  • Design the mobile version, not only the desktop one.
  • Include states, not just the happy path.
  • Keep one source for icons and export them as SVG.
  • Talk early about anything unusual, such as complex animations.

Where design and development meet

A designer decides what the experience should be. A developer decides how to make it work in a real browser on real devices. Both views are needed. Because I enjoy UI/UX as well as frontend development, I try to flag usability concerns while building, such as a button that is too small to tap, and raise them in a friendly way instead of silently changing the design.

A small example: one card, built once

To show why components matter, imagine a blog card used on the home page, the blog list and as a related post. Instead of copying markup three times, I define it once and pass data in.

export function ArticleCard({ article }: { article: Article }) {
  return (
    <div className="article-card">
      <img src={article.image} alt={article.imageAlt} />
      <h3>{article.title}</h3>
      <p>{article.readTime}</p>
    </div>
  );
}

If the designer later changes the card radius, I update one file and every instance follows. That single idea is behind most of the consistency in my builds.

Bootstrap or custom CSS?

I use Bootstrap when a project benefits from a solid grid, form styles and utilities, and then restyle it to match the design with variables and a small set of overrides. For very distinctive designs I write more custom CSS. In both cases the rule is the same: the design decides how things look, and the tool only helps me get there faster. I try never to let a framework's defaults leak into a design that did not ask for them.

Mistakes to avoid in design to code work

  • Exporting a whole page as one image instead of building real text and layout.
  • Using fixed pixel widths that fall apart on a phone.
  • Skipping semantic elements, so a page is a pile of generic containers.
  • Hard-coding the same value in many files instead of using a token.
  • Forgetting focus styles and alt text until the very end.

Final thoughts

A reliable workflow is what turns a design file into a website you can be proud of: audit, tokens, components, structure, responsiveness, interaction, review. Skipping steps usually costs more time than following them.

If you have a Figma design ready to build, send me a message or see what I offer to find out how I can help.

Tags:

  • React & Next.js
  • figma to react

Frequently Asked Questions

I audit the design, extract tokens such as colours and spacing into CSS variables, list the reusable components, build the structure and styles, make it responsive, add interactions and then compare the result against the design.

Figma can show CSS values and some plugins generate code, but the output is rarely production quality. Hand-written, componentised code is easier to maintain, accessible and faster.

It is strongly recommended. Without mobile layouts the developer has to guess how sections should adapt, and the result may differ from what you expected.

For public websites Next.js gives routing, image optimisation and server rendering out of the box, which helps both performance and search visibility.

It depends on the number of pages, the complexity of interactions and how complete the design is. A clear scope and finished design files make the biggest difference.

Related Post