Skip to main content
go-swarm-icons
On this page

Installation

Walks through installing the core module and the optional Lucide and Goldmark submodules.

Three modules, each with its own go.mod. Install only what the project needs.

Requirements

go-swarm-icons requires Go 1.25.0 or later.

Core module

The core module contains the icon manager, all four providers, the renderer, the fluent Icon API, and the SVG sanitization pipeline. It has no external dependencies beyond the Go standard library.

Terminal window
go get github.com/frostybee/go-swarm-icons@latest

Import it with the swarmicons alias:

Go
import swarmicons "github.com/frostybee/go-swarm-icons"

Lucide submodule

The Lucide submodule bundles an embedded Iconify JSON collection containing ~1,500 Lucide icons (~800 KB). It depends on the core module.

Terminal window
go get github.com/frostybee/go-swarm-icons/lucide@latest
Go
import "github.com/frostybee/go-swarm-icons/lucide"

Goldmark submodule

The Goldmark submodule adds inline :icon[prefix:name] syntax to Goldmark-processed Markdown. It depends on the core module and github.com/yuin/goldmark.

Terminal window
go get github.com/frostybee/go-swarm-icons/goldmark@latest

Import it with the swarmgoldmark alias:

Go
import swarmgoldmark "github.com/frostybee/go-swarm-icons/goldmark"

Which modules to install

  • Directory-based SVGs, no Markdown: the core module is enough.
  • Embedded Lucide icons: core + Lucide submodule.
  • Other Iconify sets (Tabler, Heroicons, ...): core module + the CLI tool below to download the sets.
  • Markdown icon syntax: core + Goldmark submodule (and optionally Lucide).

CLI tool

The swarm-icons binary is the recommended way to add icon sets beyond Lucide. It browses, downloads, and updates any Iconify set from the npm registry, with no Node.js required, producing JSON files ready for JsonCollectionProvider. It is a separate Go module and is not required by any library import.

Terminal window
go install github.com/frostybee/go-swarm-icons/cmd/swarm-icons@latest

For the full command reference, see CLI Reference. For a step-by-step walkthrough of adding icon sets, see Working with Icon Sets.

What's next

  • Quick Start: create a manager, resolve an icon, and render it to HTML
  • Core Concepts: understand providers, prefixes, and attribute layers
  • CLI Reference: browse, download, search, and export icon sets from the terminal
Edit this page

Last updated: