# Is it possible (and how) to load SVG string in Phaser 3 instead of loading it from path/url?

**URL:** <https://phaser.discourse.group/t/is-it-possible-and-how-to-load-svg-string-in-phaser-3-instead-of-loading-it-from-path-url/9668>\
**Category:** Phaser 3\
**Created:** [May 25, 2021, 8:49am UTC](https://phaser.discourse.group/t/is-it-possible-and-how-to-load-svg-string-in-phaser-3-instead-of-loading-it-from-path-url/9668 "2021-05-25T08:49:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MartinTale](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/martintale/32/5228_2.png) [@MartinTale](https://phaser.discourse.group/u/MartinTale)\
**Post date:** [May 25, 2021, 8:49am UTC](https://phaser.discourse.group/t/is-it-possible-and-how-to-load-svg-string-in-phaser-3-instead-of-loading-it-from-path-url/9668/1 "2021-05-25T08:49:59Z")

</div>

I have several SVGs in my code which I would like to use with Phaser (specifically for particles) without saving them into separate SVG files.

```
const svgString = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M24 10h-10v-10h-4v10h-10v4h10v10h4v-10h10z"/></svg>`;

function preload()
{
    // Usual way
    this.load.svg('plus', 'assets/svg/plus.svg');

    // What I would like to do
    this.load.svg('plus', svgString)
}

```

Is there a way to achieve this (and how)?

---

<div class="post-metadata">

**Author:** ![Milton](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@Milton](https://phaser.discourse.group/u/Milton)\
**Post date:** [May 25, 2021, 9:38am UTC](https://phaser.discourse.group/t/is-it-possible-and-how-to-load-svg-string-in-phaser-3-instead-of-loading-it-from-path-url/9668/2 "2021-05-25T09:38:54Z")

</div>

```javascript
const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
   <path d="M24 10h-10v-10h-4v10h-10v4h10v10h4v-10h10z"/>
</svg>`;
const blob = new Blob([svg], {type: 'image/svg+xml'});
const url = URL.createObjectURL(blob);

```

---

<div class="post-metadata">

**Author:** ![MartinTale](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/martintale/32/5228_2.png) [@MartinTale](https://phaser.discourse.group/u/MartinTale)\
**Post date:** [May 25, 2021, 5:35pm UTC](https://phaser.discourse.group/t/is-it-possible-and-how-to-load-svg-string-in-phaser-3-instead-of-loading-it-from-path-url/9668/3 "2021-05-25T17:35:30Z")

</div>

Thank you so much! You’re a life saver!
