βΆοΈHow to add icons
Add icons to your Webstudio site using SVGs and icon libraries.
This guide shows you how to easily add icons to your Webstudio website.
Method 1: Pasting SVG Directly into the Builder (Recommended)
The easiest and most powerful approach is to copy SVG code and paste it directly into Webstudio. This creates native SVG components that you can fully style and manipulate.
Step-by-Step
Find an icon from a library like Heroicons, Lucide, or Feather Icons
Copy the SVG code for the icon
In Webstudio, click where you want the icon on the canvas
Paste (Cmd+V / Ctrl+V) β Webstudio will automatically create the SVG structure with proper components
Webstudio converts the SVG into native components, giving you full control over styling each part directly in the Style panel.
SVG Properties in Style Panel
When you select an SVG element, the Style Panel shows SVG-specific CSS properties, including:
fill β The fill color of the shape
stroke β The stroke (outline) color
stroke-width β The thickness of the stroke
fill-opacity β Transparency of the fill
stroke-opacity β Transparency of the stroke
stroke-linecap β Shape at the end of lines (butt, round, square)
stroke-linejoin β Shape at corners (miter, round, bevel)
stroke-dasharray β Create dashed lines
stroke-dashoffset β Offset for dash pattern
And many more SVG-specific properties.
SVG Attribute Autocompletion
In the Settings Panel, when you add custom attributes to SVG elements, Webstudio provides autocompletion for all valid SVG attributes. This helps you set properties like:
viewBoxβ Define the coordinate systempreserveAspectRatioβ Control scaling behaviortransformβ Apply transformationsPath-specific attributes like
d,points,cx,cy,r, etc.
Pasting SVG creates native components that can be styled with CSS Variables, allowing you to create icons that change color based on themes or states.
Method 2: Using HTML Embed with SVG
For more complex SVGs or when you need the raw SVG code:
Add an HTML Embed component where you want the icon
Paste the SVG code into the HTML Embed
Style the icon using inline attributes or CSS
Styling SVG Icons
To control icon color and size, modify the SVG:
Using currentColor allows the icon to inherit text color from its parent.
Method 3: Using Icon Fonts
You can also use icon fonts like Font Awesome:
Add the Font Awesome CSS to your project's custom code (Project Settings > Custom Code)
Use an HTML Embed with the icon's HTML class:
<i class="fa-solid fa-star"></i>
Method 4: Using Image Component
For simple icons that don't need color changes:
Export your icon as PNG or SVG file
Upload to Webstudio Assets
Add an Image component and select the uploaded icon
Set appropriate width/height
Related
Image β Use images for simple icon needs
HTML Embed β Embed custom SVG code and icon fonts
Design Tokens β Create reusable color tokens for icon styling
Variables β Use CSS variables to dynamically change icon colors
Last updated
Was this helpful?
