PHPackages                             lindemannrock/craft-icon-manager - 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. lindemannrock/craft-icon-manager

ActiveCraft-plugin[Utility &amp; Helpers](/categories/utility)

lindemannrock/craft-icon-manager
================================

Comprehensive icon management field supporting SVG libraries and icon fonts for Craft CMS

5.12.0(1mo ago)0124↓100%1proprietaryPHPPHP ^8.3CI passing

Since Sep 1Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/LindemannRock/craft-icon-manager)[ Packagist](https://packagist.org/packages/lindemannrock/craft-icon-manager)[ RSS](/packages/lindemannrock-craft-icon-manager/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (70)Used By (0)

Icon Manager for Craft CMS
==========================

[](#icon-manager-for-craft-cms)

[![Latest Version](https://camo.githubusercontent.com/8e473c2ace5137b05011d31ab516b9ee17c1ad9afd5a4ee46dc852d7bda81b92/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c696e64656d616e6e726f636b2f63726166742d69636f6e2d6d616e616765722e737667)](https://packagist.org/packages/lindemannrock/craft-icon-manager)[![Craft CMS](https://camo.githubusercontent.com/c176c7ad994b4d577c758871323311a223477bd0cd427c40a8472fd0cad04992/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4372616674253230434d532d352e302b2d6f72616e67652e737667)](https://craftcms.com/)[![PHP](https://camo.githubusercontent.com/83d697baa78e4225d630587096ed1b0d8a0ece94e9b2ebab599fc9bb986477ac/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332b2d626c75652e737667)](https://php.net/)[![Logging Library](https://camo.githubusercontent.com/9f888210e896f206c091faebf48bba25432d6cb565949a794784d624ef3a9c32/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6f6767696e672532304c6962726172792d352e302b2d677265656e2e737667)](https://github.com/LindemannRock/craft-logging-library)[![License](https://camo.githubusercontent.com/f297da55e93fb21586d009ecb9a3090cb04999c679f4c20694b773edebde1fc4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c696e64656d616e6e726f636b2f63726166742d69636f6e2d6d616e616765722e737667)](LICENSE)

A comprehensive icon management field supporting SVG libraries and icon fonts for Craft CMS 5.x.

License
-------

[](#license)

This is a commercial plugin licensed under the [Craft License](https://craftcms.github.io/license/). It will be available on the [Craft Plugin Store](https://plugins.craftcms.com) soon. See [LICENSE.md](LICENSE.md) for details.

⚠️ Pre-Release
--------------

[](#️-pre-release)

This plugin is in active development and not yet available on the Craft Plugin Store. Features and APIs may change before the initial public release.

Table of Contents
-----------------

[](#table-of-contents)

- [Icon Manager for Craft CMS](#icon-manager-for-craft-cms)
    - [Table of Contents](#table-of-contents)
    - [Quick Start](#quick-start)
    - [Features](#features)
    - [Development Status](#development-status)
    - [Requirements](#requirements)
    - [Installation](#installation)
        - [Via Composer](#via-composer)
        - [Using DDEV](#using-ddev)
        - [Via Control Panel](#via-control-panel)
    - [Configuration](#configuration)
        - [Plugin Settings](#plugin-settings)
        - [Config File](#config-file)
            - [Available Configuration Options](#available-configuration-options)
            - [Scan Control Settings](#scan-control-settings)
        - [Creating Icon Sets](#creating-icon-sets)
            - [SVG Folder](#svg-folder)
            - [SVG Sprite](#svg-sprite)
            - [Font Awesome](#font-awesome)
            - [Material Icons](#material-icons)
            - [Web Font](#web-font)
    - [Usage](#usage)
        - [Field Type](#field-type)
        - [Template Variables](#template-variables)
            - [Basic Icon Rendering](#basic-icon-rendering)
            - [Working with Icon Objects](#working-with-icon-objects)
            - [List Icons from a Set](#list-icons-from-a-set)
            - [Search Icons](#search-icons)
            - [Working with Icon Sets](#working-with-icon-sets)
        - [Rendering Options](#rendering-options)
    - [Icon Metadata](#icon-metadata)
        - [Basic Structure](#basic-structure)
        - [Advanced Structure with Multilingual Support](#advanced-structure-with-multilingual-support)
        - [Label Resolution Priority](#label-resolution-priority)
        - [Supported Metadata Properties](#supported-metadata-properties)
    - [Security](#security)
        - [Automatic Sanitization](#automatic-sanitization)
        - [How It Works](#how-it-works)
        - [What's Not Sanitized](#whats-not-sanitized)
        - [Template Safety](#template-safety)
    - [Field Settings](#field-settings)
        - [Icon Size](#icon-size)
        - [Show Labels](#show-labels)
        - [Enable Search](#enable-search)
    - [Caching](#caching)
        - [Configuration](#configuration-1)
        - [Cache Management](#cache-management)
    - [Logging](#logging)
    - [Permissions](#permissions)
    - [Environment-Specific Paths](#environment-specific-paths)
    - [SVG Optimization](#svg-optimization)
        - [Enabling/Disabling Optimization](#enablingdisabling-optimization)
        - [Optimization Features](#optimization-features)
        - [Issue Detection](#issue-detection)
        - [PHP Optimizer (Default)](#php-optimizer-default)
        - [SVGO (Advanced)](#svgo-advanced)
        - [Scan Controls vs SVGO Configuration](#scan-controls-vs-svgo-configuration)
    - [Missing Icon Handling](#missing-icon-handling)
    - [Performance Tips](#performance-tips)
        - [For Large Icon Sets (500+ icons)](#for-large-icon-sets-500-icons)
        - [For Material Icons](#for-material-icons)
        - [Cache Strategy by Environment](#cache-strategy-by-environment)
    - [Troubleshooting](#troubleshooting)
        - [Icons Not Showing in Picker](#icons-not-showing-in-picker)
        - [Icons Not Rendering in Templates](#icons-not-rendering-in-templates)
        - [Optimization Not Working](#optimization-not-working)
        - [Performance Issues with Large Icon Sets](#performance-issues-with-large-icon-sets)
        - [Config File Not Working](#config-file-not-working)
    - [Examples](#examples)
    - [Support](#support)
    - [License](#license)

Quick Start
-----------

[](#quick-start)

Get up and running with Icon Manager in 5 minutes:

**1. Install the plugin**

```
composer require lindemannrock/icon-manager
./craft plugin/install icon-manager
```

**2. Create your first icon set**

- Go to **Icon Manager → Icon Sets** in the Control Panel
- Click **"New Icon Set"**
- Choose **"SVG Folder"** as the type
- Select a folder containing SVG files (or use the default `/icons` folder)
- Save the icon set

**3. Add an icon field to your section**

- Go to **Settings → Fields**
- Create a new **"Icon Manager"** field
- Add it to your entry type
- Start selecting icons in your entries!

**That's it!** Icons are now available in your templates via `{{ entry.iconField.render() }}`.

See [Usage](#usage) below for template examples and advanced features.

Features
--------

[](#features)

- **Multiple Icon Formats**: Support for SVG files, SVG sprites, Font Awesome, Material Icons, and custom web fonts
- **Intuitive Interface**: Searchable icon picker with preview, tabs/dropdown for multiple sets
- **Flexible Configuration**: Configure icon sets and field settings (size, labels, search)
- **Performance Optimized**: File or Redis caching for fast icon loading
- **Security**: SVG sanitization to prevent XSS attacks
- **Twig Integration**: Easy icon rendering in templates with automatic HTML safety
- **GraphQL Support**: Icon fields expose structured icon data in Craft GraphQL schemas

Development Status
------------------

[](#development-status)

⚠️ **Beta Features** - The following features are currently in testing and finalization:

- **SVG Sprite support** - Basic functionality implemented, advanced features pending
- **Material Icons** - Core integration complete, variable fonts being refined
- **Font Awesome** - Free icons working, Pro/Kit support in development
- **Web Font** - Custom icon font support (TTF, WOFF, OTF) with glyph extraction

SVG folder icons are fully stable and production-ready.

Requirements
------------

[](#requirements)

- Craft CMS 5.0 or greater
- PHP 8.3 or greater
- [Logging Library](https://github.com/LindemannRock/craft-logging-library) 5.0 or greater (installed automatically as dependency)

Installation
------------

[](#installation)

### Via Composer

[](#via-composer)

```
cd /path/to/project
```

```
composer require lindemannrock/craft-icon-manager
```

```
./craft plugin/install icon-manager
```

### Using DDEV

[](#using-ddev)

```
cd /path/to/project
```

```
ddev composer require lindemannrock/craft-icon-manager
```

```
ddev craft plugin/install icon-manager
```

### Via Control Panel

[](#via-control-panel)

In the Control Panel, go to Settings → Plugins and click "Install" for Icon Manager.

Configuration
-------------

[](#configuration)

### Plugin Settings

[](#plugin-settings)

Settings can be configured in the Control Panel at Settings → Icon Manager, or via a config file.

1. **Icon Sets Path**: Set the path to your icon files (default: `@root/icons`)
2. **Cache Settings**: Configure caching for better performance
3. **Display Settings**: Set default display options
4. **Icon Types**: Enable/disable different icon set types

### Config File

[](#config-file)

Create a `config/icon-manager.php` file to override default settings:

```
cp vendor/lindemannrock/craft-icon-manager/src/config.php config/icon-manager.php
```

```
