Download the PHP package mblode/svgplaceholder without Composer
On this page you can find all versions of the php package mblode/svgplaceholder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download mblode/svgplaceholder
More information about mblode/svgplaceholder
Files in mblode/svgplaceholder
Download mblode/svgplaceholder
More information about mblode/svgplaceholder
Files in mblode/svgplaceholder
Vendor mblode
Package svgplaceholder
Short Description A plugin which generates an invisible SVG of specific dimensions for use when lazyloading images in Craft CMS templates.
License MIT
Package svgplaceholder
Short Description A plugin which generates an invisible SVG of specific dimensions for use when lazyloading images in Craft CMS templates.
License MIT
Please rate this library. Is it a good library?
Informations about the package svgplaceholder
# SVG Placeholder
**Generates an invisible SVG of exact dimensions to hold the space while a Craft image lazyloads**
One Twig call returns a base64 data URI you drop straight into a `src` attribute.
Install
Run that in your Craft project root, then install SVG Placeholder from Settings, Plugins in the control panel.
Quickstart
That renders a transparent 300 by 500 SVG as a base64 data URI, so the browser reserves the right space before the real image arrives.
Usage
Pass a color as the second argument to get a visible block instead of a transparent one:
With a JS lazyloader such as lazysizes, read the dimensions off the transformed asset:
Requirements
- Craft CMS 3.
composer.jsonrequirescraftcms/cms ^3.0.0-RC1, and the plugin has never been updated for Craft 4 or later. - Nothing else. The SVG is assembled and base64 encoded in PHP, with no build step and no extra extension.
Notes
- Browsers now cover most of this without a plugin:
loading="lazy"on an<img>withwidthandheightset, or a CSSaspect-ratio, reserves the space on its own. This is still useful where a JS lazyloader needs a realsrcto swap out. - Based on the Craft 2 plugin SVG Placeholder by Dalton Rooney.
- Last released in 2017, and unmaintained since.
License
MIT
Crafted by
Matthew Blode
All versions of svgplaceholder with dependencies
PHP Build Version
Package Version
Requires
craftcms/cms Version
^3.0.0-RC1
The package mblode/svgplaceholder contains the following files
Loading the files please wait ...