Figma’s code layers put real, running code on your canvas, and you don’t need to be a developer to use them. In this article, you’ll learn what code layers are, the different ways to create one, and what to check before you bring in your team’s code.
Static mockups are good at showing the happy path. The headline fits on one line, the list has exactly six items, and there is never a hanging loading spinner.
Real products are messier, and that mess is usually where the design questions are. Figma’s code layers put real, running code directly on your canvas, next to the frames you already work in, so you can see how a design behaves before it ships. And no, you don’t need to learn to code to use them.
I’m excited about code layers because they give designers a chance to work with material we haven’t been able to touch before: the actual product. At Sparkbox, we’re just starting to experiment with code layers, and I’ve been doing exploratory work so I can make recommendations to our clients. But getting started was harder than I expected, and I could see a lot of designers getting stuck the same way I did. So this first part is practical. It covers what code layers are and how to get one running. In part two, I’ll get into how I use them.
What is a code layer?
Think of it as a browser window you can drop on the canvas.

It sits next to your frames like any other layer, but inside it is a working website or app. Press Play and you can click through it, move from page to page, and see how it behaves. Resize the layer and it acts like you’re resizing a browser window, so you can watch the layout respond.
That lets you test the states that mockups tend to skip: the empty state, the loading state, the error message, and the headline that’s 12 characters longer than the one you designed for.
Code layers are currently in open beta. To make one, select Code from the toolbar or press B.
Why use code layers?
One of the problems I see most often on design teams is that the design files don’t represent what’s going on in production. Code layers let you work with the product as it exists today. You click through the same code your users see, and you make changes to that code directly.
That matters because Figma files drift. Developers ship approved changes, like a tweaked button style or a new spacing value, and those changes don’t always make it back into the design file. Over time, the file and the product stop matching, and designers end up building on an outdated version. At Sparkbox, we’ve written about finding and fixing that drift, but it’s even better to avoid it in the first place.
Working from the live code avoids that problem. You begin with what’s already shipped, so you can jump ahead to the new work without first auditing the file or worrying about design system drift. That’s the part I find most exciting.
You might be wondering how this is different from vibe coding, where you describe what you want to an AI tool and it builds an app for you, usually from scratch. Vibe coding is great for quick experiments, but what you get is a standalone app with no connection to your product. It doesn’t use your team’s components, and nothing you make there goes back to your developers. Code layers can work that way too (starting from nothing is one of the options below), but when you clone your team’s repository, you’re exploring with the same building blocks your developers use, and your changes can go back to them for review.
I’m also excited about what code layers make possible. Some things are easy in code and hard in Figma. Figma’s prototyping handles basic and moderately complex interactions well, but when I want something to look and feel real, like an animation or a detailed interaction, putting it in code is the way to do it. With code layers, that prototype lives right next to my designs.
Five ways to start
When you create a code layer, Figma asks where the code should come from.
Start from nothing. Begin with a blank code layer and prompt Figma’s AI agent: “Build a pricing page with three tiers,” or “Add a toggle for monthly and yearly billing.” You can also point it at other frames in your file and say, “Take this layout and build it in code.”
Start from your designs. Select one or more frames on the canvas and click Build selection to turn them into an interactive code layer.
Capture a live webpage. With the Figma Chrome extension, you can capture code from a webpage and paste it into your file as a code layer.
Upload a folder. A project’s code lives in a folder of files, a lot like a folder of design assets. If a developer gives you a copy of that folder, you can upload it straight into Figma. It gives you a space to play: you can make changes, share the Figma file with your developers, and keep exploring. An uploaded folder has no connection back to GitHub, though, so you can’t send your changes back to the codebase from it.
Clone a repository (the best option). Cloning connects your code layer to your team’s codebase on GitHub, so the work you do can go back to your developers as real code. It takes a little more setup, and it’s the option that gets you the most out of code layers.
Before you clone: will this even work?
This is where I got stuck the first time. Nothing was broken. I just didn’t know what to do next. The interface didn’t make it obvious, and I ended up dumpster diving through Figma’s documentation to piece the steps together. The next few sections are what I wish I’d had in one place.
Not every codebase can run in a code layer. The requirements aren’t complicated, and plenty of projects already meet them, but it’s worth checking before you get your hopes up.
Questions to ask your developer
At Sparkbox, designers and developers work closely together, so this is rarely a formal request. It’s usually a quick conversation, and a good excuse to sit down together, open the repository, and work through these questions side by side. The same developer will likely help you with branches and pull requests later, so bringing them in early pays off.
Is it a web app? Code layers only support web apps and websites. Native iOS, Android, and desktop apps won’t work.
Is it on GitHub? Cloning only works with GitHub right now, not Bitbucket or GitLab. If your code lives elsewhere, a developer can usually move or mirror it to GitHub, though your organization may need to approve that.
Does it have a build script and an entry point? More on this below.
Is the repository under 3 GB? If it’s bigger, ask whether there’s a smaller repository with just the components you want to prototype with.
Does it use private npm packages? Public packages are fine. Private packages that require a login aren’t supported.
Is it behind a VPN, firewall, or IP allowlist? If so, Figma can’t connect to it.
Or check it yourself in five minutes
Open the repository on GitHub.
Find the file called
package.jsonat the top level. It lists the project’s commands and the packages it uses.Look for a section called
scripts. You want to see abuildcommand, which turns the source code into a working app.While you’re there, look for a command like
startordev, or anindex.htmlfile in the project. That’s the entry point, the file that starts the app.If both are there, you’re probably in good shape.

Not comfortable reading code files? Copy the contents of package.json into an AI assistant and ask, “Does this project have a build script and an entry point?” It’ll tell you, and explain what it found. Check your company’s AI policy first, since this means sharing part of your codebase.
Getting connected to GitHub
You need a GitHub account, and your Figma admin needs to connect your Figma team or organization to a GitHub organization. Each Figma team or organization can connect to only one GitHub organization. (Code layers are new as of this writing, so this may change.)
For a product team, that’s rarely a problem: it’s your product’s GitHub organization. For agencies, it’s a real limitation. If each client keeps its code in its own GitHub organization, one Figma team or organization can’t connect to all of them. On a Professional plan, where the connection is set per team, you could set up a separate Figma team for each client. On other plans, code layers are a better fit today for in-house product teams than for agencies working across many clients.
If you’re the Figma admin, here’s how to connect GitHub:
In Figma, select Admin from the sidebar.
Go to Settings.
Under Resources, select Figma GitHub app.
Follow the prompts to sign in to GitHub, choose your organization and repositories, and click
Install & Authorize.
If you’re a Figma admin but not an admin of the GitHub organization, you’ll see an option to request access instead, and a GitHub organization admin will need to approve it. The connection applies to your whole Figma team or organization, so it’s a one-time setup.

Once you’re connected, create a code layer and choose Clone Repository. You’ll see a searchable list of repositories. Two things to know about that list:
You only see repositories you have access to. You might see dozens, or just a few.
Seeing a repository doesn’t mean it will work. The list shows what you can access, not what meets the requirements above.
You can also clone a public repository by pasting its URL, with no GitHub connection at all. That’s handy for exploring, but you can’t send changes back from a public clone.
A quick tour of the layer

Every code layer has three controls in its upper-right corner.
Comment opens the code editor in browser mode, so you can click around the live app and leave comments on specific spots.
Open code editor opens the same view, for working on the code.
Play turns the code layer from a static snapshot into a live, interactive panel on the canvas.
Inside the code editor
You’ll see Browser, Files, and a + button.
Browser shows the rendered app, just like a web browser. This is also where you’ll find the Edit tool: click any element in the running app and you get a familiar Figma-style properties panel for colors, padding, margins, and text styles. Make your changes, click Apply, and the agent updates the code.
Files shows the code itself: every folder and file in the project. You can also edit the code directly here. Spot a typo in a button label? Find it in the code, fix it, and skip asking the agent.
The plus icon (+) reveals two more tools.
Terminal is where you give the project instructions by typing instead of clicking. Developers use it for tasks like installing a package the project needs. You probably won’t need it often, but if a developer asks you to run a command, this is where you paste it.
Review shows a before-and-after of everything you’ve changed, called a diff (short for “difference”). Think of it as version history for code, showing exactly which lines changed. Changed a corner radius from 8px to 4px? You’ll see exactly that.
Going back to design
Code layers work in both directions. Extract designs turns what’s in a code layer back into editable design layers on the canvas. You can grab the current state or a single element, or record yourself clicking through a flow, and Figma will create a frame for each screen.
Compare directions side by side
You can duplicate a code layer just like any other layer, and each copy is its own separate set of code. When your layer is connected to a repository, each copy can sit on its own branch: a separate version of the code where changes don’t affect the original, much like duplicating a page to try a new direction.
That means three identical layers can become three directions. Change one and the others stay exactly as they were. Press Play on all three and you can click through live, working versions side by side on the same canvas.
Sending your work to developers
When you clone a repository, your code layer starts on the branch you picked, often the main one your developers work from. When you send changes back to GitHub, they go straight to that branch, and possibly into what gets deployed. That means your experiment could end up live.
Before you change anything, create a new branch. If you’ve used branching in Figma, this works the same way: you make changes in a separate copy, then ask for them to be reviewed and merged back into the main version. Here’s the full process:
Create a branch. Click the current branch name under the prompt box in the code editor and choose
Create branch, or ask the agent: “Create a branch for the new pricing toggle.” If you’ve already made changes, ask the agent to move them to a new branch.
Make your changes on that branch.
When you’re happy with what you’ve built, click Create PR. That opens a pull request in GitHub, a formal request for developers to review your changes, comment on them, and preview them.
Instead of a static frame and a page of annotations, developers get the code changes you made. They might merge your work directly or use it as a starting point. Either way, they start with a much clearer picture of what you’re trying to accomplish.
Be patient. It’s thinking, not broken.
Code layers can be slow. Figma is running and rendering real code, and that takes time. The code editor can take a while to open, and after the agent makes changes, you may need to click Reload code layer to see them.
If it feels like nothing is happening, give it a minute.
A few heads-ups
Anyone who can edit the file can see the code. When you clone a repository into a code layer, anyone with edit access to that Figma file can see the source code, even without access to it in GitHub. Think before you share.
Figma adds a few files to the project. The first time a repository is cloned, Figma adds configuration files in a
.figma/makefolder so the code can run. They’re safe to merge, but let your developers know so they aren’t surprised in the pull request.Code layers use AI credits. During the open beta, credits are used whenever the agent does work for you. That includes the first time you turn code into a code layer, since the agent runs prompts to get it working, as well as building a layer from your designs, responding to a prompt, or applying changes from the Edit tool. Once a code layer is set up, opening, playing, and browsing it doesn’t use credits. The amount varies with how complex the task is.
The bottom line
For me, the promise of code layers is simple: designers get to work from the real product instead of a copy that’s slowly going out of date, and they can explore ideas that Figma’s prototyping can’t quite reach. You don’t have to become a developer to use them. You just have to get one set up, and now you know how.
Drop one into your next file, press Play, and see what your design does when it meets real code.
Coming up in part two: Now that you can get a code layer running, I’ll share how I use them: making changes, exploring interactions that are hard to prototype in Figma, and working with developers on the code you send back.



