Elements
Icons
What Icons Are Included
-
Heroicons (
/app/assets/icons/heroicons
) -
Tabler Icons (
/app/assets/icons/tabler
)
Rendering An Icon
-
We use the inline_svg gem.
-
To render an icon, use the following snippet and swap out the name of the file and the classes as necessary.
Add Classes
Most commonly used to change the size or color.
FAQ
Why use inline_svg instead of a normal image or asset tag?
Why use inline_svg instead of a normal image or asset tag?
Normal image tags don’t allow us to specify a class that gets add to the svg element itself. Instead, they render an <img>
that points to the svg, which is different to rendering the svg directly.