How do you export and optimize a Figma SVG for web?
This tests your design-to-code workflow. A strong answer covers: selecting the vector layer, adding an SVG export in the right sidebar, and running the output through SVGO to strip metadata and flatten transforms.
What's really being asked
This question tests whether a candidate understands the full pipeline from design asset to production code, not just clicking export. Interviewers want to see that you know Figma's export mechanics and, more importantly, that you understand SVGs exported from design tools contain editor-specific bloat that hurts web performance and maintainability. It separates candidates who treat design tools as black boxes from those who actively clean assets for engineering use.
The full answer
First, the selection step: you would select the specific icon layer, frame, or component in Figma, then locate the Export section in the right sidebar. If you have edit access it appears at the bottom of the sidebar; if you have view-only access it sits under the Properties tab. You add an export preset and set the format to SVG. Second, the optimization step: you would run the exported file through an optimizer like SVGO, SVGOMG, or a Figma plugin such as SVGO Compressor before export. The goal is to remove unnecessary Figma metadata, non-semantic IDs, editor comments, and empty groups, and to flatten transforms into clean paths. Third, the code readiness step: you would verify the viewBox and width or height attributes are correct, convert fixed hex fills to currentColor if the icon needs CSS theming, and ensure there are no inline styles that override external CSS. Fourth, the validation step: you would open the SVG in a browser or embed it inline in HTML to check for rendering parity with the original design.
The mistakes people make
A major red flag is saying you would simply download the SVG and drop it into the codebase without inspection. Another is suggesting PNG or JPG for a simple icon, which misses the scalability and file-size benefits of vector graphics. Some candidates mention using the Slice tool for a single icon, which is unnecessary and indicates confusion about when slices are actually useful. Claiming that Figma exports perfectly clean SVGs by default is also incorrect, as the export typically includes metadata and non-optimized path data.
What usually comes next
The interviewer might ask how you handle icons that need multiple colors or gradients, which would change whether you use currentColor or keep inline fill attributes. They might ask how you automate this across a large icon library, where you could mention batch processing with SVGO config files or design system pipelines. They could also ask about accessibility, prompting you to discuss adding meaningful title elements or aria labels, and when to use img tags with alt text versus inline SVG.
A concrete example
Suppose you have a 24 by 24 heart icon in Figma. You select the vector layer, add an SVG export preset, and download the file. The raw export contains a Figma-generated ID and a transform attribute on a group. You drop the code into SVGOMG and enable pretty print, then remove the ID and flatten the transform. You change the fill from hash 000000 to currentColor so the icon inherits the parent text color in CSS. Finally, you paste the cleaned SVG inline into a React component or save it as an asset. The file size drops from roughly two kilobytes to under five hundred bytes, and it renders crisply at any scale.
Interview question
Which step is essential to make a Figma-exported SVG suitable for production web code?
- a.Import the raw SVG directly because Figma exports are clean by default
- b.Convert the export format to PNG to guarantee cross-browser compatibility
- c.Use the Slice tool to frame the icon before downloading the SVG
- d.Run the exported file through an optimizer to strip metadata and flatten transformsCorrect
Why? this is the answer
Figma SVG exports contain editor bloat like metadata and unnecessary transforms that must be removed with an optimizer such as SVGO. Importing the raw file is a common misconception because design tools do not output production-ready code by default.
Just read this? Test yourself on what you have been reading.
Read the original → help.figma.com
- #figma
- #svg
- #web-performance
- #design-systems
- #frontend
Put your scrolling time to good use
Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on figma — each one lists the topics its interview covers.
See open roles