PHPackages                             iconify/json - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. iconify/json

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

iconify/json
============

Iconify icons collection in JSON format

2.2.455(1mo ago)95655.3k↓16.3%90[2 PRs](https://github.com/iconify/icon-sets/pulls)11MITTypeScriptCI passing

Since Oct 21Pushed 1mo ago9 watchersCompare

[ Source](https://github.com/iconify/icon-sets)[ Packagist](https://packagist.org/packages/iconify/json)[ Docs](https://iconify.design/icon-sets/)[ RSS](/packages/iconify-json/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1277)Used By (11)

Iconify icon sets in JSON format
================================

[](#iconify-icon-sets-in-json-format)

This is a big collection of open source vector icons, all validated, cleaned up and converted to the same easy to use format.

Even though all icon sets are open source, some icon sets require attribution.

See [collections.md](./collections.md) for list of icon sets and their licenses.

Validation and clean up
-----------------------

[](#validation-and-clean-up)

All icons have been processed with [Iconify Tools](https://iconify.design/docs/libraries/tools/) to clean them up.

Icon parsing process includes:

- Very strict validation and clean up. Icons do not contain scripts, event listeners, fonts, raster images, external resources and unknown elements.
- Colors for monotone icons have been replaced with `currentColor`, making it easy to change icon color by changing text color.
- Icon content has been optimised to reduce its size.

Maintenance
-----------

[](#maintenance)

This repository is automatically updated several times a week, so it always contains the latest icons for all icon sets.

Format
------

[](#format)

Icon sets are stored in `IconifyJSON` format. TypeScript definition is available in `@iconify/types` package. Documentation is [available on Iconify Documentation website](https://iconify.design/docs/types/iconify-json.html).

To work with icon sets, use [Iconify Utils](https://iconify.design/docs/libraries/utils/). Utils package works in any JavaScript environment: Node.js, Deno, browsers, isolated JavaScript environments.

Usage
-----

[](#usage)

These icons can be used with many tools, plugins and components. They can also be exported as individual SVG files.

See [Iconify documentation](https://iconify.design/docs/usage/) for more details.

How to get this repository
--------------------------

[](#how-to-get-this-repository)

Instructions below are for Node.js and PHP projects.

### Node.js

[](#nodejs)

Run this command to add icons to your project:

```
npm install --save @iconify/json
```

Icons will be available in node\_modules/@iconify/json

To resolve filename for any json file, use this if you are using CommonJS syntax:

```
import { locate } from '@iconify/json';

// returns location of mdi-light.json
const mdiLightFilename = locate('mdi-light');
```

### PHP

[](#php)

Install and initialize Composer project. See documentation at

Then open composer.json and add following code:

```
"require": {
    "php": ">=5.6",
    "iconify/json": "*"
}
```

then run:

```
composer install
```

Icons will be available in vendor/iconify/json/

If you don't use Composer, clone GitHub repository and add necessary autoload code.

To resolve filename for any json file, use this:

```
// Returns location of mdi-light.json
$mdiLightLocation = \Iconify\IconsJSON\Finder::locate('mdi-light');
```

Data format
-----------

[](#data-format)

Icons used by Iconify are in directory json, in Iconify JSON format.

Why JSON instead of SVG? There are several reasons for that:

- Easy to store images in bulk.
- Contains only content of icon without `` element, making it easy to manipulate content without doing complex parsing. It also makes it easier to create components, such as React icon component, allowing to use framework native SVG element.
- Data can contain additional content: aliases for icons, icon set information, categories/tags/themes.

Why not XML?

- JSON is much easier to parse without additional tools. All languages support it.

Format of json file is very simple:

```
{
  "prefix": "mdi-light",
  "icons": {
    "icon-name": {
      "body": "",
      "width": 24,
      "height": 24
    }
  },
  "aliases": {
    "icon-alias": {
      "parent": "icon-name"
    }
  }
}
```

"icons" object contains list of all icons.

Each icon has following properties:

- body: icon body.
- left, top: left and top coordinates of viewBox, default is 0.
- width, height: dimensions of viewBox, default is 16.
- rotate: rotation. Default = 0. Values: 0 = 0deg, 1 = 90deg, 2 = 180deg, 3 = 270deg.
- hFlip: horizontal flip. Boolean value, default = false.
- vFlip: vertical flip. Boolean value, default = false.
- hidden: if set to true, icon is hidden. That means icon was removed from collection for some reason, but it is kept in JSON file to prevent applications that rely on old icon from breaking.

Optional "aliases" object contains list of aliases for icons. Format is similar to "icons" object, but without "body" property and with additional property "parent" that points to parent icon. Transformation properties (rotate, hFlip, vFlip) are merged with parent icon's properties. Any other properties overwrite properties of parent icon.

When multiple icons have the same value, it is moved to root object to reduce duplication:

```
{
  "prefix": "mdi-light",
  "icons": {
    "icon1": {
      "body": ""
    },
    "icon2": {
      "body": ""
    },
    "icon-20": {
      "body": "",
      "width": 20,
      "height": 20
    }
  },
  "width": 24,
  "height": 24
}
```

In example above, "icon1" and "icon2" are 24x24, "icon-20" is 20x20.

For more information see developer documentation on [https://iconify.design/docs/types/iconify-json.html](https://docs.iconify.design/types/iconify-json.html)

Extracting individual SVG icons
-------------------------------

[](#extracting-individual-svg-icons)

You can use [Iconify Utils](https://iconify.design/docs/libraries/utils/) for simple export process or [Iconify Tools](https://iconify.design/docs/libraries/tools/) for more options.

Example using Iconify Utils (TypeScript):

```
import { promises as fs } from 'fs';

// Function to locate JSON file
import { locate } from '@iconify/json';

// Various functions from Iconify Utils
import { parseIconSet } from '@iconify/utils/lib/icon-set/parse';
import { iconToSVG } from '@iconify/utils/lib/svg/build';
import { defaults } from '@iconify/utils/lib/customisations';

(async () => {
  // Locate icons
  const filename = locate('mdi');

  // Load icon set
  const icons = JSON.parse(await fs.readFile(filename, 'utf8'));

  // Parse all icons
  const exportedSVG: Record = Object.create(null);
  parseIconSet(icons, (iconName, iconData) => {
    if (!iconData) {
      // Invalid icon
      console.error(`Error parsing icon ${iconName}`);
      return;
    }

    // Render icon
    const renderData = iconToSVG(iconData, {
      ...defaults,
      height: 'auto',
    });

    // Generate attributes for SVG element
    const svgAttributes: Record = {
      'xmlns': 'http://www.w3.org/2000/svg',
      'xmlns:xlink': 'http://www.w3.org/1999/xlink',
      ...renderData.attributes,
    };
    const svgAttributesStr = Object.keys(svgAttributes)
      .map(
        (attr) =>
          // No need to check attributes for special characters, such as quotes,
          // they cannot contain anything that needs escaping.
          `${attr}="${svgAttributes[attr as keyof typeof svgAttributes]}"`
      )
      .join(' ');

    // Generate SVG
    const svg = `${renderData.body}`;
    exportedSVG[iconName] = svg;
  });

  // Output directory
  const outputDir = 'mdi-export';
  try {
    await fs.mkdir(outputDir, {
      recursive: true,
    });
  } catch (err) {
    //
  }

  // Save all files
  const filenames = Object.keys(exportedSVG);
  for (let i = 0; i  {
  const svg = iconSet.toString(name);
  if (!svg) {
    return;
  }

  // Save to file
  await writeFile(`${outputDir}/${name}.svg`, svg, 'utf8');
  console.log(`Saved ${outputDir}/${name}.svg (${svg.length} bytes)`);
});
```

See [Iconify Tools documentation](https://iconify.design/docs/libraries/tools/export/) for more export options.

License
-------

[](#license)

This is collection of icon sets created by various authors.

See [collections.md](./collections.md) for list of icon sets and their licenses.

###  Health Score

68

—

FairBetter than 100% of packages

Maintenance89

Actively maintained with recent releases

Popularity55

Moderate usage in the ecosystem

Community32

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 93.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

1270

Last Release

54d ago

Major Versions

1.1.457 → 2.0.262022-01-19

1.1.458 → 2.0.272022-01-21

1.1.459 → 2.0.282022-01-24

1.1.460 → 2.0.292022-01-26

v1.x-dev → 2.0.302022-01-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/0534089f50247dd2425b5ae50a618c61ff7d23a28f755cd0bb43fe8d93d2d707?d=identicon)[cyberalien](/maintainers/cyberalien)

---

Top Contributors

[![cyberalien](https://avatars.githubusercontent.com/u/822287?v=4)](https://github.com/cyberalien "cyberalien (1388 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (71 commits)")[![userquin](https://avatars.githubusercontent.com/u/6311119?v=4)](https://github.com/userquin "userquin (18 commits)")[![DannyFeliz](https://avatars.githubusercontent.com/u/5460365?v=4)](https://github.com/DannyFeliz "DannyFeliz (1 commits)")[![oktaysenkan](https://avatars.githubusercontent.com/u/42527467?v=4)](https://github.com/oktaysenkan "oktaysenkan (1 commits)")[![velut](https://avatars.githubusercontent.com/u/12040076?v=4)](https://github.com/velut "velut (1 commits)")

### Embed Badge

![Health badge](/badges/iconify-json/health.svg)

```
[![Health](https://phpackages.com/badges/iconify-json/health.svg)](https://phpackages.com/packages/iconify-json)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
