Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Simple Icons

No security coverage Under active development 38 sites

This module allows users to easily add over 789 brand icons to content using a field widget, formatter, or Twig function. The icons are provided as clean, monochrome SVG markup that can be styled with CSS, making it simple for content creators to include brand logos without manual uploads.

Simple Icons provides a field widget/field formatter and Twig function to output one of 789+ brand icons from the Simple Icons project.

The icon is output as raw SVG markup so it can be easily styled with CSS, but the markup is sanitized before being output for security (just in case!)

Each icon is monochrome so fits easily into most designs and has been optimised for performance.

Why? (Usage)

This module allows your CMS users to use almost any major brand icon that they like, without you having to source, optimize, and upload these logos yourself.

If your client has a list of social media profiles in their footer then you could build it as a Drupal menu, install the Menu Item Extras module, and then add a Simple Icons icon field to the menu. Or use Config Pages and a Paragraph type to do a similar thing (outputting the Config Pages entity as a block, just like a menu).

Then, if a client wanted to add a new social media profile they could do it all themselves, including supplying an icon. No more support tickets to 'Add a link to X in the footer'!

As a convenience and for non-CMS managed content a Twig function is provided to output a single icon:

{{ simple_icons_icon('drupal') }}

The Twig function accepts a single argument of the slug that represents each icon. The slugs can be found in the icon-data.json file found in the module root.

Requirements

Make sure that you have extracted the contents of the Simple Icons repo to libraries/simple-icons.

My preferred way of doing this is via Asset Packagist. Follow this guide then run the following Composer command:

composer require npm-asset/simple-icons

Once you have done this, running the following command from your Drupal site's webroot should return SVG markup:

cat libraries/simple-icons/icons/drupal.svg

Installation

Once the Simple Icons library is in the correct location (see Requirements) then you can install this module as normal.

After installation you will have a 'Simple Icons icon' field type and field formatter available, as well as the Twig function mentioned above.

Configuration

There is currently no need for configuration.

Theming

Need to add an CSS class to the icons provided by this module? Override the simple-icons-icon.html.twig template provided by this module and you can edit the markup of the <svg> element that wraps the icons.

Accessibility

A <title> element is contained within each SVG with the name of the brand that is represented by the icon.

What icons are available/can I add an icon?

Drupal 8–11

Ask your assistant about Simple Icons

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

  • field Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Dec 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Core PHP Release date
2.0.0 Stable 8–11 Dec 20, 2024