Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

SVG Formatter

Security covered Under active development 5,734 sites

This module allows you to upload and display SVG image files on your Drupal website. It provides a special formatter for file fields that enables you to control the size and attributes of your SVGs, and can even embed them directly into your pages for advanced styling with CSS and JavaScript.

SVG Formatter module provides support for using SVG images on your website.

The standard image field in Drupal doesn't support SVG images. This module adds a new formatter for the file field, which allows files with any extension to be uploaded. In the formatter settings, you can set the default image size and enable alt and title attributes. If you want to add some CSS and Javascript magic to your SVG images, then use the inline SVG option.

You can also use this module in combination with SVG Image module. If that module is installed, you can use the SVG Formatter formatter for the image field.

Installation

Composer

composer require drupal/svg_formatter

Drush

drush en svg_formatter -y

How to use it?

Drupal and SVG images - Blog post describing how to use the module

Screencast: https://youtu.be/ctussLn-2Ck

1. Add a file field to your content type, taxonomy, or any other entity type, and add svg to the allowed file extensions.
2. Go to the 'Manage display' and change the field format to 'SVG Formatter'.
3. Set image dimensions if you want and enable or disable attributes.

Drupal 10–11

Ask your assistant about SVG Formatter

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

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
6
Tracked since
May 2023
Latest release
17 hours ago
Releases (12 mo)
1 ▼ from 2
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
2.0.6 Stable 10–11 Oct 15, 2026
2.0.5 Stable 10–11 Aug 15, 2025
2.0.4 Stable 10–11 Dec 31, 2024
2.0.3 Stable 9–10 Mar 16, 2024
8.x-1.18 Stable 8–9 May 1, 2023
2.0.2 Stable 9–10 May 1, 2023