Skip to content

Updating Icon Sets

The json:update command checks npm for newer versions of your downloaded JSON icon sets and updates them in place. It compares the version stored in your swarm-icons.json manifest against the latest release on npm.

Terminal window
# Check what's outdated without downloading anything
php vendor/bin/swarm-icons json:update --dry-run
# Update everything
php vendor/bin/swarm-icons json:update
# Update specific sets only
php vendor/bin/swarm-icons json:update mdi tabler
  1. The command reads your swarm-icons.json manifest to find which sets are installed and what version each one was downloaded at.
  2. For each set, it queries the npm registry for the latest version of @iconify-json/{prefix}.
  3. It displays a comparison table so you can see what changed.
  4. Unless --dry-run is set, it downloads and replaces any outdated JSON files and records the new versions in the manifest.

The output shows a table with the status of each set:

---------- --------- --------- ------------------
Prefix Current Latest Status
---------- --------- --------- ------------------
mdi 7.4.47 7.5.0 update available
tabler 3.31.0 3.31.0 up to date
heroicons unknown 2.2.0 unknown version
---------- --------- --------- ------------------
StatusMeaning
up to dateInstalled version matches the latest npm release
update availableA newer version exists on npm
unknown versionThe set was downloaded before version tracking was added; it will be re-downloaded to record its version
fetch failedThe npm registry could not be reached for this set
OptionShortDescriptionDefault
--dry-runShow the version table without downloadingfalse
--dest-dJSON files directoryauto-detected

Version tracking is built into the swarm-icons.json manifest. When you download sets with json:download or update them with json:update, each set’s npm version is stored alongside the prefix list:

{
"json-sets": ["mdi", "tabler"],
"versions": {
"mdi": "7.4.47",
"tabler": "3.31.0"
}
}

The versions key is optional. Old manifests that only contain json-sets still work; json:update will treat those sets as having an unknown version and offer to re-download them.

You can add update checks to your CI pipeline or a Composer script:

"scripts": {
"icons:update": "swarm-icons json:update"
}

Then run composer icons:update to keep your icon sets current.