PHPackages                             mblode/svgplaceholder - 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. [Templating &amp; Views](/categories/templating)
4. /
5. mblode/svgplaceholder

ActiveCraft-plugin[Templating &amp; Views](/categories/templating)

mblode/svgplaceholder
=====================

A plugin which generates an invisible SVG of specific dimensions for use when lazyloading images in Craft CMS templates.

1.0.3(8y ago)107.3k31MITPHP

Since Sep 8Pushed 2y agoCompare

[ Source](https://github.com/mblode/svgplaceholder)[ Packagist](https://packagist.org/packages/mblode/svgplaceholder)[ RSS](/packages/mblode-svgplaceholder/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (1)Versions (4)Used By (1)

SVG Placeholder plugin for Craft CMS 3.x
========================================

[](#svg-placeholder-plugin-for-craft-cms-3x)

A plugin which generates an invisible SVG of specific dimensions for use when lazyloading images in Craft CMS templates.

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

[](#requirements)

This plugin requires Craft CMS 3.0.0-beta.23 or later.

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

[](#installation)

To install the plugin, follow these instructions.

1. Open your terminal and go to your Craft project:

    ```
     cd /path/to/project

    ```
2. Then tell Composer to load the plugin:

    ```
     composer require mblode/svgplaceholder

    ```
3. In the Control Panel, go to Settings → Plugins and click the “Install” button for svgplaceholder.

Usage
-----

[](#usage)

```
{{ craft.svgplaceholder.generate({height:500,width:'300'}) }}

```

Optionally add a background color with the fill attribute:

```
{{ craft.svgplaceholder.generate({height:500,width:'300'},'#CCCCCC') }}

```

Example
-------

[](#example)

When used with Lazysizes and a macro:

*\_macros/utilities.html*

```
{% macro lazyLoadImage(element, transform) %}
        {% cache using key element.id %}

        {% endcache %}
{% endmacro %}

```

*index.html*

```
{% import '_macros/utilities' as utils %}

...

{{ utils.lazyLoadImage(image, 'imageTransformName') }}

```

---

Brought to you by [Matthew Blode](https://matthewblode.com)

Based on the Craft CMS 2 plugin: [SVG Placeholder](https://github.com/daltonrooney/svgplaceholder)

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 82.4% 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 ~48 days

Total

3

Last Release

3124d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7183998?v=4)[Matthew Blode](/maintainers/mblode)[@mblode](https://github.com/mblode)

---

Top Contributors

[![mblode](https://avatars.githubusercontent.com/u/7183998?v=4)](https://github.com/mblode "mblode (14 commits)")[![daltonrooney](https://avatars.githubusercontent.com/u/742045?v=4)](https://github.com/daltonrooney "daltonrooney (3 commits)")

---

Tags

cmsCraftcraft-plugincraft cmssvg placeholder

### Embed Badge

![Health badge](/badges/mblode-svgplaceholder/health.svg)

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

###  Alternatives

[verbb/formie

The most user-friendly forms plugin for Craft.

102393.6k70](/packages/verbb-formie)[wbrowar/guide

A CMS Guide for Craft CMS.

6154.7k1](/packages/wbrowar-guide)[verbb/vizy

A flexible visual editor field for Craft.

4250.4k](/packages/verbb-vizy)[verbb/hyper

A user-friendly links field for Craft.

24147.8k12](/packages/verbb-hyper)[verbb/footnotes

Adds a footnotes feature to CKEditor fields and Twig templates.

213.6k](/packages/verbb-footnotes)[verbb/events

A full-featured plugin for event management and ticketing.

2311.9k](/packages/verbb-events)

PHPackages © 2026

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