Skip to content
Web Development

How to Convert a Figma Design to Next.js Step by Step

Learn how to convert a Figma design to Next.js: audit the file, set up tokens, build reusable components, handle breakpoints and plan a CMS.

Keshur Gojiya

6 min read

How to Convert a Figma Design to Next.js Step by Step

To convert a Figma design to Next.js, you don't export code from Figma. You read the design as a system (colours, type scale, spacing, components), turn those decisions into design tokens and reusable React components, and then build each page from them with Tailwind CSS or plain CSS. Done this way, the site matches the design closely, stays easy to change, and performs well. Here is the process I follow on client projects.

Why not just use a Figma-to-code plugin?

Plugins that export HTML or React from Figma are fine for quick experiments. For a production site I avoid them, for three reasons:

  • The output mirrors the layers in Figma, not the structure a browser needs. You get absolutely positioned boxes and deeply nested divs.
  • It is usually not responsive. Figma frames are fixed widths; a real site has to work from small phones to wide monitors.
  • It has no semantic HTML. Headings, lists, buttons and landmarks matter for accessibility and SEO, and a plugin can't guess them reliably.

A developer reading the design and writing clean components is still the most dependable route.

Step 1: Audit the Figma file before writing code

Spend an hour here and you save days later. Check these things first:

  1. Are styles and components used consistently? If every heading has a slightly different size, ask the designer which values are intended.
  2. Are there mobile and tablet frames? If only desktop exists, agree how the layout should collapse before you start, not after.
  3. Which parts repeat? Buttons, cards, nav, footer, section headers and form fields become components.
  4. What is content and what is structure? Blog posts, team members and case studies will probably live in a CMS later, so build them as data-driven components from day one.
  5. What is missing? Hover and focus states, error states, empty states, loading states. Designs rarely cover them all, so list the gaps and get answers.

Step 2: Turn design decisions into tokens

Pull the colours, font sizes, spacing and radii out of Figma and define them once. With Tailwind CSS v4 you can do this directly in your CSS file with @theme:

@import "tailwindcss";

@theme {
--color-brand: #1f4fd8;
--color-ink: #111827;
--color-surface: #f8fafc;
--font-display: "Inter", sans-serif;
--radius-card: 12px;
}

Now bg-brand, text-ink and rounded-card exist as utility classes, and changing the brand colour later is a one-line edit. If you use an older Tailwind version, the same values go into tailwind.config.js. If you don't use Tailwind at all, CSS custom properties on :root give you the same benefit.

Match Figma's text styles to a small, named type scale instead of copying pixel values everywhere. Designers also appreciate it when you say "this is the h2 style" rather than "this is 38px".

Step 3: Build reusable components, not pages

Start with the smallest pieces: button, link, input, badge. Then the blocks made from them: card, section heading, navigation. Only then assemble pages.

Each component should take its content as props and own its own styling. A button component, for example, should render one consistent element for primary and secondary variants, with focus and disabled states built in. This is what keeps a 20-page site consistent when someone adds page 21 six months later.

Here is the kind of semantic markup a component should end up producing:

<section class="py-16">
  <div class="mx-auto max-w-6xl px-4">
    <h2 class="text-3xl font-semibold text-ink">Our services</h2>
    <ul class="mt-8 grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
      <li class="rounded-card bg-surface p-6">
        <h3 class="text-xl font-medium">Design to code</h3>
        <p class="mt-2 text-ink/80">Short description here.</p>
      </li>
    </ul>
  </div>
</section>

Notice the real heading hierarchy, a list for repeated items, and no fixed widths.

How do you handle responsive breakpoints from a Figma design?

Treat the Figma frames as examples, not as the only sizes that exist. My approach:

  1. Build mobile first. Write the small-screen layout as the default, then add changes with sm:, md: and lg: prefixes as the screen grows.
  2. Add breakpoints where the layout breaks, not where devices are. If a three-column grid looks cramped at 900px, change it at 900px, even if no Figma frame shows it.
  3. Use fluid values. Percentages, max-width containers, grid and flex with wrapping, and clamp() for type adapt to in-between sizes that Figma never shows.
  4. Test in a real browser. Drag the window from 320px to 1920px and fix whatever looks off. That check takes ten minutes and catches most issues.

If the designer provided only a desktop frame, ask for a mobile version of at least the header, hero and one card section. Guessing on mobile is the most common source of "it doesn't look like the design" feedback.

Step 4: Handle images, fonts and performance

Next.js gives you tools that a plain export would not:

  • Use the next/image component for images. It serves appropriately sized files and reserves space so the layout doesn't jump.
  • Use next/font to load fonts without layout shift and without an extra request to a third-party font host.
  • Export SVG icons and logos from Figma as SVG, and photos at the size they will actually display, not at original size.
  • Keep most components as server components and mark only interactive ones, like menus or sliders, as client components. Less JavaScript sent to the browser means a faster page.

Step 5: Plan for a CMS early

If the client will edit content themselves, decide on the CMS before you build the page templates. A headless CMS such as Sanity lets you define content types (post, service, testimonial) that match your components, so editors change text and images without touching code. Retrofitting this onto hard-coded pages is possible but slower than building the data shape in from the beginning.

Step 6: Review against the design with the designer

Compare the build to Figma side by side at the desktop and mobile widths. Check spacing, type sizes, colours, and states. Then walk through it with the designer, because they will spot things I don't, like optical alignment or a button that feels too tight. Getting a short list of changes in one round is far better than a dozen small messages.

If you'd rather hand this whole process to someone, my Figma to Next.js service covers exactly these steps.

FAQ

Can Figma export directly to Next.js code?

Figma's own Dev Mode shows measurements, CSS values and assets, and plugins can generate code snippets. None of them produce a finished, responsive, accessible Next.js site by themselves. They are a reference, and a developer still builds the components.

How long does it take to build a Figma design in Next.js?

It depends on the number of unique pages and components, and on how complete the design is. A design with consistent styles and mobile frames is much faster to build than one that needs decisions made along the way. I'd rather give a fixed estimate after seeing the Figma file than quote a generic number.

Should I use Tailwind CSS for a Figma design?

Tailwind works well because Figma's spacing and type values map neatly to utility classes and tokens. It is not required, though. CSS Modules or plain CSS with custom properties produce the same result if your team prefers them.

What should designers prepare to make handoff smoother?

Use Figma styles and components consistently, name layers meaningfully, supply mobile and tablet frames, and include hover, focus and error states. A short note on intended behaviour, such as what happens on scroll or in a menu, saves a lot of back and forth.

Key takeaways

  • Don't export code from Figma. Read the design as a system and build tokens and components from it.
  • Build mobile first and add breakpoints where the layout actually breaks.
  • Use next/image, next/font and server components to keep the site fast.
  • Decide on the CMS before building templates, so content is data-driven from the start.

Tags

  • Next.js
  • Figma
  • Tailwind CSS
  • Responsive Design

About Keshur Gojiya

Web developer and HTML email specialist with 6+ years of experience, building websites and emails for businesses, startups and agencies.

Get to know me
Keep Reading
View All Articles
  • Web Development

    7 min read

    WordPress to Next.js Migration Checklist: 6 Stages in Order

    A WordPress to Next.js migration checklist in six stages: audit, build, redirects, staging QA, launch day and the first weeks, so nothing gets lost.

    • WordPress Migration
    • Next.js
    Keshur Gojiya
  • Web Development

    6 min read

    How to Hire a Next.js Developer: What to Check and Ask

    How to hire a Next.js developer: what to check in their work, questions to ask before you sign, red flags, freelancer vs agency, and how to write a clear brief.

    • Next.js
    • Best Practices
    Keshur Gojiya
  • Web Development

    7 min read

    Is a Headless CMS Good for SEO? What to Set Up

    Is a headless CMS good for SEO? Yes, if the site is built right. The checklist: rendering, SEO fields, URLs, sitemaps, redirects, images and page speed.

    • SEO
    • Sanity CMS
    Keshur Gojiya

Need help with an email or website?

If an email is breaking in Outlook or dark mode, or you have a design that needs building, tell me about it and I’ll reply with next steps.

Email me