PHPackages                             stevie-mayhew/silverstripe-svg - 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. stevie-mayhew/silverstripe-svg

ActiveSilverstripe-vendormodule[Templating &amp; Views](/categories/templating)

stevie-mayhew/silverstripe-svg
==============================

Basic SVG support for SilverStripe

3.0.0(11mo ago)23326.5k↓17.6%8[1 PRs](https://github.com/stevie-mayhew/silverstripe-svg/pulls)4MITPHPCI passing

Since Nov 23Pushed 11mo ago1 watchersCompare

[ Source](https://github.com/stevie-mayhew/silverstripe-svg)[ Packagist](https://packagist.org/packages/stevie-mayhew/silverstripe-svg)[ RSS](/packages/stevie-mayhew-silverstripe-svg/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (19)Used By (4)

SilverStripe SVG
================

[](#silverstripe-svg)

Basic SVG support for SilverStripe templates

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

[](#requirements)

SilverStripe 4 or higher

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

[](#installation)

`composer require stevie-mayhew/silverstripe-svg`

Configuration
-------------

[](#configuration)

You can set the base path for where your SVG's are stored. You can also add extra default classes to the SVG output

```
StevieMayhew\SilverStripeSVG\SVGTemplate:
  base_path: 'themes/base/production/svg/'
  default_extra_classes:
    - 'svg-image'
```

Usage
-----

[](#usage)

In a SilverStripe template simply call the SVG template helper.

```

{$SVG('name')}

{$SVG('with-id', 'testid')}
```

There also helper functions for width, height, size, fill, adding extra classes, setting a custom/alternative base path and specifying a sub-folder within the base path (for those who want to categories and folder off your images).

```

{$SVG('name').width(200)}

{$SVG('name').height(200)}

{$SVG('name').size(100,100)}

{$SVG('name').fill('#FF9933')}

{$SVG('name').stroke('#FF9933')}

{$SVG('name').extraClass('awesome-svg')}

{$SVG('name').customBasePath('assets/Uploads/SVG')}

{$SVG('name').addSubfolder('MyDir')}
{$SVG('name').addSubfolder('MyDir/MyOtherDir')}
{$SVG('name').addSubfolder('MyDir').addSubfolder('MyOtherDir')}
```

These options are also chainable.

```
{$SVG('name').fill('#45FABD').width(200).height(100).extraClass('awesome-svg').customBasePath('assets/Uploads/SVG').addSubfolder('MyDir')}
```

### Example Output

[](#example-output)

```

```

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance51

Moderate activity, may be stable

Popularity46

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 65.6% 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 ~240 days

Recently: every ~554 days

Total

17

Last Release

340d ago

Major Versions

1.0.x-dev → 2.0.02017-08-23

2.4.1 → 3.0.02025-06-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/a499234983660ff4b31982de5e17e147544b717227fc4f7245070462fd03cbca?d=identicon)[stevie-mayhew](/maintainers/stevie-mayhew)

---

Top Contributors

[![stevie-mayhew](https://avatars.githubusercontent.com/u/1953220?v=4)](https://github.com/stevie-mayhew "stevie-mayhew (21 commits)")[![obj63mc](https://avatars.githubusercontent.com/u/443120?v=4)](https://github.com/obj63mc "obj63mc (5 commits)")[![wilr](https://avatars.githubusercontent.com/u/101629?v=4)](https://github.com/wilr "wilr (2 commits)")[![deracs](https://avatars.githubusercontent.com/u/909343?v=4)](https://github.com/deracs "deracs (1 commits)")[![adrexia](https://avatars.githubusercontent.com/u/984753?v=4)](https://github.com/adrexia "adrexia (1 commits)")[![ChrissiQ](https://avatars.githubusercontent.com/u/1127719?v=4)](https://github.com/ChrissiQ "ChrissiQ (1 commits)")[![sunnysideup](https://avatars.githubusercontent.com/u/167154?v=4)](https://github.com/sunnysideup "sunnysideup (1 commits)")

---

Tags

phpsilverstripesvgsvg-supportsilverstripesvgtemplate

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/stevie-mayhew-silverstripe-svg/health.svg)

```
[![Health](https://phpackages.com/badges/stevie-mayhew-silverstripe-svg/health.svg)](https://phpackages.com/packages/stevie-mayhew-silverstripe-svg)
```

###  Alternatives

[silverstripe/login-forms

A collection of templates for the CMS login screens

191.3M26](/packages/silverstripe-login-forms)[silverstripe-themes/simple

The SilverStripe simple theme (default SilverStripe 3 theme)

411.3M8](/packages/silverstripe-themes-simple)[symbiote/silverstripe-listingpage

A module that allows CMS users to create templated listing pages.

1012.7k2](/packages/symbiote-silverstripe-listingpage)

PHPackages © 2026

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