DEV Community

SVGMaker
SVGMaker

Posted on

Editing an SVG in the browser: colours, paths, text and groups

You have an SVG that is almost right. The colour is off, one curve is lumpy, or the text says the wrong thing. The usual fix is a desktop design app, or reading the XML by hand. Both are slow for a small change.

Here is how to make the common edits in our free SVG Editor, which runs in the browser.

How do you change one colour?

Click the shape and pick a new colour. If the shape sits inside a group, double-click the group first. In SVG, a colour is just an attribute on the shape:

<!-- before -->
<path d="M10 10h80v80H10z" fill="#2563eb" />
<!-- after -->
<path d="M10 10h80v80H10z" fill="#16a34a" />
Enter fullscreen mode Exit fullscreen mode

How do you fix a path?

Switch to path editing and drag the anchor points and Bézier handles. Snapping helps here: points lock to the grid, to nearby objects and to equal spacing as you drag, so a "nearly straight" line becomes straight.

In the file, that is the path's d attribute changing. One thing to know: the editor writes a fresh file when you export, so the markup will not match the original line for line, even where the drawing does.

How do you edit text?

Click the text and type. Pick a font from more than 90 web fonts with a live preview. The font stays with the file, so the text looks the same when someone opens it on a machine that does not have that font installed.

How do you work with groups?

Exported SVGs often wrap shapes in <g> groups. The editor keeps each top-level group as one object, so a logo moves as a whole. Double-click a group to step inside it and edit one shape, then step out. The group stays as it was. The Layers panel shows a live thumbnail of every object. Drag a layer to reorder it, or rename it.

When you need a group split apart for good, ungroup it. Grouping and ungrouping change the file's structure, and this guide on grouping and ungrouping SVG elements explains when to use each.

What can you export?

Export Use it for
SVG Web, print, cutting machines
PNG Places that only take images
React / React Native Drop the icon straight into components
HTML/CSS Inline markup for a page

You can also export one selected object on its own, such as a single icon from a sheet.

When is the editor not enough?

When the change is bigger than a fix, such as a new style or a new layout, describing it is faster than dragging points. The editor has an AI edit mode for that, covered in the Advanced Editing docs.

For small changes, click the part that is wrong and fix it. No need to start over.

Top comments (0)