tezvyn:

From Design to Code: Inspecting in Figma

AI-drafted, machine-checkedSource: help.figma.combeginner

Inspection translates a design into code-ready specs. It's the "view source" for a design file, showing exact colors, sizes, and spacing. Developers use it to build UIs; designers use it to verify consistency. Don't blindly copy auto-generated code.

WHY IT EXISTS To bridge the gap between a visual design mockup and the actual code needed to build it. Without inspection, developers would have to guess at sizes, colors, and spacing from a static image, leading to inconsistencies and a slow, error-prone workflow.

THE MENTAL MODEL Inspection is like a "view source" for a design file. It lets you click on any visual element—a button, a text block, an image—and see all its technical properties: its exact color hex code, its font size, its padding, and its distance from other elements. It turns a picture of an interface into a blueprint for building it.

HOW IT WORKS How you inspect depends on your access level, but the core actions are available even with view-only permissions in Design Mode. First, select an object on the canvas. The "Properties" tab in the right sidebar will show its attributes like color, typography, and layout. To measure the distance between two objects, select the first one, hold the Option (Mac) or Alt (Windows) key, and hover over the second. Figma will display the spacing. You can also generate starter code by right-clicking an object and selecting "Copy/Paste as > Copy as code". For images and icons, use the "Export" panel to configure and save assets.

WHEN TO USE IT Use inspection during the handoff phase from design to development. Developers rely on it to get the exact values needed to write CSS, iOS, or Android UI code that matches the design pixel-for-pixel. QA engineers can also use it to verify that a feature in a staging environment matches the approved Figma design.

WHEN NOT TO USE IT Do not treat the auto-generated code snippets as production-ready. They are a starting point and often lack the context of your project's existing codebase, style conventions, or responsive behavior. Always review and refactor the generated code. Also, inspection is for reading data, not writing it; if you need to make changes, you need edit access, not just inspection tools.

ONE CANONICAL EXAMPLE A developer is tasked with building a user profile card from a Figma design. They select the card's container to get its background color, border radius, and shadow properties. They then select the user's avatar, hold Alt, and hover over the username to get the exact 16px spacing between them. Finally, they select the username text to find its font is Inter, weight is Semi-Bold, and size is 18px. In a few clicks, they have all the CSS values needed to style the component.

Read the original → help.figma.com

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.