Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Facets 3.0.6 Minor update available for module facets (3.0.6). Release: Facets 3.0.5 Minor update available for module facets (3.0.5). Release: Flag 5.1.0 Minor update available for module flag (5.1.0). Release: Block Layout Accordion 1.0.2 Minor update available for module block_layout_accordion (1.0.2). Release: Canvas interactive toggle 1.0.2 Minor update available for module canvas_interactive_toggle (1.0.2). Release: Views HTTP Client 1.0.2 Minor update available for module views_http_client (1.0.2). Release: Block Layout Accordion 1.0.1 Minor update available for module block_layout_accordion (1.0.1). Release: Canvas interactive toggle 1.0.1 Minor update available for module canvas_interactive_toggle (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

SVG Sprite

29 sites Security covered Drupal 10–11
View on drupal.org

This module allows you to manage and display icons from SVG sprite files. It provides a field type to select icons from a dropdown, automatically populated from your sprite's symbol IDs. Icons can then be easily inserted into content or Twig templates.

This module adds a new field type called SVG Sprite. Using this field you can select an icon from a dropdown list which is auto-generated from a SVG Sprite file.

It reads the SVG Sprite and automatically adds every <symbol id="">...</symbol> to the list, which is typically how SVG Sprites are generated.

It outputs something similar to file.svg#symbol-id using a dedicated field formatter.

A submodule is available to allow insertion of SVG sprites in CKEditor 5 WYSIWYG editor.

A small Twig extension is also available allowing to easily add an SVG sprite into your Twig templates.

Example: {{ svg_sprite('lightbulb') }}.

You can add custom attributes to your sprite Twig function:

{{ svg_sprite('lightbulb', {'class': 'my_css_class'}) }}

This will produce:

<svg class="sprite sprite-lightbulb my_css_class"...>
  ...
</svg>

An experimental token is also available: [svg_sprite:sprite:lightbulb] but might requires to allow svg and use HTML tags rendering in some contexts like Views (XSS).

A small utility function in the SvgSpriteHelper class shows how to programmatically override the Xss::$adminTags property to allow the use of the svg and use HTML tags.

Similar or related projects

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
17
Tracked since
Oct 2024
Latest release
5 months ago
Releases (12 mo)
5 ▼ from 12
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
1.1.5 Stable 10–11 Mar 10, 2026
1.1.4 Stable 10–11 Nov 19, 2025
1.x-dev Dev 10–11 Nov 17, 2025
1.1.3 Stable 10–11 Nov 17, 2025
1.1.2 Stable 10–11 Oct 10, 2025
1.1.1 Stable 10–11 Jan 7, 2025
1.1.0 Stable 10–11 Dec 3, 2024
1.1.x-dev Dev 10–11 Dec 3, 2024
1.0.0 Stable 10–11 Nov 6, 2024
1.0.0-beta3 Pre-release 10–11 Oct 22, 2024
1.0.0-beta2 Pre-release 10–11 Oct 14, 2024
1.0.0-beta1 Pre-release 10–11 Oct 14, 2024
1.0.0-alpha4 Pre-release 10–11 Oct 11, 2024
1.0.0-alpha3 Pre-release 10–11 Oct 10, 2024
1.0.0-alpha2 Pre-release 10–11 Oct 10, 2024
1.0.0-alpha1 Pre-release 10–11 Oct 9, 2024
1.0.x-dev Dev 10–11 Oct 9, 2024