Navigate Select ESC Close

I finally get how SVGs work

2025-09-03 Science & Technology
113.9k
5.9k
248
Theo - t3․gg
Theo - t3․gg
539.0k subscribers

Unlock all features

FREE: Get instant access to 10 AI summaries, chats, or transcripts per day.

Description

SVGs are awesome, but do any of us really understand how they work? Thank you Mobbin for sponsoring! Check them out at: https://soydev.link/mobbin SOURCE https://www.joshwcomeau.com/svg/friendly-introduction-to-svg/ Want to sponsor a video? Learn more here: https://soydev.link/sponsor-me Check out my Twitch, Twitter, Discord more at https://t3.gg S/O Ph4se0n3 for the awesome edit 🙏

Top Comments (10)

@joshuawcomeau 2025-09-04

Thanks for sharing my post, Theo! Glad it was helpful. 😄

421 6 replies
@bloody_albatross 2025-09-03

Inkscape doesn't mush everything together into one path element. But instead it adds layer and metadata elements that might bloat the file size. It's not that bloated, but for icons embedded on websites you want it as small as possible. So then I manually strip anything unnecessary. But since inkscape is based on SVG you have direct control over the exact elements that you get. IIRC you can even give them the id/class attributes that you want directly in inkscape. Also inkscape is open source AND can be used to render SVGs via command line options without opening a window. So I use inkscape in some Makefiles to "compile" SVGs to PNG at various sizes etc.

248 24 replies
@ajwhitewolf 2025-09-03

Side note: this whole video is why I disagreed with an earlier take that SVG code doesn't belong in React. You unlock soooo much power by dynamically rendering SVG code using React - but yeah, you lose all of it when everything in your SVG is one illegible path element.

73
@haroonsaifi17 2025-09-03

I'm jealous of how good that blog looks and how much effort he puts into it. I hope I can build something like that one day if I stay dedicated and make the time.

57
@hemiphillips786 2025-09-03

I’m just over halfway through and I’ve already learnt so much from this video. Thanks Josh (and Theo)

56
@davidjesus8629 2025-09-03

finally a non AI related vid...

15
@kkrll 2025-09-03

svg filters is a huuuge topic to cover. one of the useful parts about it is that it allows you to create custom css filters (proper shadows and background blurs are the most useful)

11
@wayne_logan 2025-09-03

21:05 "That strokes had that level of customization"

10
@FirstZion-1237 2025-09-03

I've done a decent amount of work with Canvas in the past, and I had no idea how much crossover there was between them and SVGs. This makes them so much more approachable! Thanks for finding/showing this off!

9
@alvieridev 2025-09-15

1:56 I hardly skip Theo’s ads. They come as information than ads to me

1

Unlock the Data Inside
Turn Videos into Knowledge

  • Get FREE 10/day: transcripts, summaries, chats
  • Chat with videos, export text & PDF
  • $1 free API credit for RAG, chatbots & research

Free forever plan • All features unlocked

App screenshot