PHPackages                             clubstudioltd/craft-inline-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. [Image &amp; Media](/categories/media)
4. /
5. clubstudioltd/craft-inline-svg

ActiveCraft-plugin[Image &amp; Media](/categories/media)

clubstudioltd/craft-inline-svg
==============================

A plugin to aid inlining SVGs

2.1.0(2y ago)335.1k↑592.3%[9 PRs](https://github.com/clubstudio/craft-inline-svg/pulls)1MITPHPCI failing

Since Nov 17Pushed 3w ago1 watchersCompare

[ Source](https://github.com/clubstudio/craft-inline-svg)[ Packagist](https://packagist.org/packages/clubstudioltd/craft-inline-svg)[ RSS](/packages/clubstudioltd-craft-inline-svg/feed)WikiDiscussions master Synced 3d ago

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

[![](./src/icon.svg)](./src/icon.svg)

Craft CMS Inline SVG
====================

[](#craft-cms-inline-svg)

[![Build Status](https://camo.githubusercontent.com/cd027acec1685d44a40633b4b742ef9d7a52608272cefe63fc5909ec4da69adf/68747470733a2f2f7472617669732d63692e636f6d2f636c756273747564696f6c74642f63726166742d696e6c696e652d7376672e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/clubstudioltd/craft-inline-svg)[![Latest Stable Version](https://camo.githubusercontent.com/c978f6a5c18b45418435b6da2408668b676160913f7425784f741fefa695bb37/68747470733a2f2f706f7365722e707567782e6f72672f636c756273747564696f6c74642f63726166742d696e6c696e652d7376672f762f737461626c65)](https://packagist.org/packages/clubstudioltd/craft-inline-svg)[![Total Downloads](https://camo.githubusercontent.com/9cff6a076418bf0317d17c55deac28936fb894e2742da648a35acf4b8f8f1fa6/68747470733a2f2f706f7365722e707567782e6f72672f636c756273747564696f6c74642f63726166742d696e6c696e652d7376672f646f776e6c6f616473)](https://packagist.org/packages/clubstudioltd/craft-inline-svg)[![Latest Unstable Version](https://camo.githubusercontent.com/7f7d792623727f69c41d32cbc8ade91c89fa8166aef69c82521da7cc17efc5c0/68747470733a2f2f706f7365722e707567782e6f72672f636c756273747564696f6c74642f63726166742d696e6c696e652d7376672f762f756e737461626c65)](https://packagist.org/packages/clubstudioltd/craft-inline-svg)[![License](https://camo.githubusercontent.com/d604f6525c4b7c2e21de95176f60327238177bd197fe97d1b317ef1446cb6a2a/68747470733a2f2f706f7365722e707567782e6f72672f636c756273747564696f6c74642f63726166742d696e6c696e652d7376672f6c6963656e7365)](https://packagist.org/packages/clubstudioltd/craft-inline-svg)

A Twig extension for Craft CMS that helps you inline SVGs in your templates.

Why?
----

[](#why)

While Craft provides an `svg()` function out of the box, you need to pass an Asset element or full path every time you use it. If all of your SVGs are stored in the same (or a handful of) directories, this plugin allows you to use shorter, more convenient syntax to inline your SVG.

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

[](#installation)

Install via the Plugin Store within your Craft 3 installation or using Composer:

`composer require clubstudioltd/craft-inline-svg`

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

[](#configuration)

The plugin comes with a `config.php` file that defines some sensible defaults.

If you want to set your own values you should create a `inlinesvg.php` file in your Craft `/config` directory. The contents of this file will get merged with the plugin defaults, so you only need to specify values for the settings you want to override.

### Example Config

[](#example-config)

```
