Inline SVGs with Rails and Vite

Author:
Source

Sponsored:

Atlas of AI: Power, Politics, and the Planetary Costs of Artificial Intelligence - Audiobook


Uncover the true cost of artificial intelligence.

Listen now, and see the system behind the screens before the future listens to you. = > Atlas of AI $0.00 with trial. Read by Larissa Gallagher


Vite is fast and powerful replacement for webpacker or the traditional Rails asset pipeline, and inline SVGs are quickly becoming the popular way to render easy-to-style icons on the web. This post explains two approaches to inlining SVGs when using Vite-Rails: using the inline_svg gem, or creating a custom view helper. https://mattbrictson.com/blog/inline-svg-with-vite-rails

Read more