A Hugo module
Inline SVG icons, with parameters.
Export icons from any of the 200+ Iconify sets, then size, rotate, flip, recolor, and label them straight from templates and Markdown, with accessibility handled by default.
Every icon on this page is rendered by the module at build time. The output is byte-tested against the go-swarm-icons Go library.
size= width= height=
Sizing
Give one dimension and the other derives from the icon's aspect ratio, CSS units preserved. The banner icon below has a non-square 20×24 viewBox; the module keeps it undistorted.
3.6em from the 20×24 viewBox.40, ratio intact.rotate= flip=
Rotate and flip
Rotation and flips collapse into a single transform declaration, and they append to any style you pass instead of overwriting it.
fill= stroke= style=
Color
Icon sets draw with currentColor, so icons inherit the surrounding CSS color with no configuration. Override per instance with style, fill, or stroke.
title= attrs=
Accessibility
Decorative icons are hidden from screen readers. Pass title or aria-label and the icon switches to labeled mode. This is the module's real output, byte for byte.
<svg aria-hidden="true" focusable="false" height="24" viewBox="0 0 24 24" width="24" …>
title="Notifications"<svg height="24" role="img" viewBox="0 0 24 24" width="24" …> <title>Notifications</title>
assets/icons/{prefix}/{name}.svg
Any Iconify set
Nothing is bundled. The swarm-icons CLI exports sanitized SVGs from Tabler, Heroicons, Font Awesome, Material Design, Simple Icons, and 200+ other sets, no Node.js required. Referencing an icon you haven't exported fails the build with the exact command to fix it.