jamesbwi/blade-svg is a Laravel package for embed svgs in laravel blade..
It currently has 1 GitHub stars and 916 downloads on Packagist (latest version 0.1.5).
Install it with composer require jamesbwi/blade-svg.
Discover more Laravel packages by jamesbwi
or browse all Laravel packages to compare alternatives.
Last updated
This package allows for easy use and manipulation of svg files within your laravel project.
You can install the package via composer:
composer require jamesbwi/blade-svg
To insert an SVG file, simply use the following component:
<x-blade-svg src="img/apple.svg"/>
You can pass any attribute into the component as if it were an inline svg:
<x-blade-svg src="img/apple.svg" class="apple-animation" viewBox="0 0 50 100"/>
If you wish to utilise the SVG <use> tags this package simplifies the process.
The following component will embed the SVG into an <element> tag with the specified attributes:
<x-blade-svg-def id="apple" src="img/apple.svg" viewBox="0 0 50 100"/>
The element (or any other SVG with an id) can then be referenced with the following tag:
<x-blade-svg-use href="#apple"/>
You can add any attribute to the <use> tag:
<x-blade-svg-use href="#apple" class="apple-animation" width="500px" preserveAspectRatio="none"/>
External sources can be referenced too:
<x-blade-svg-use href="fruit-bowl.svg#pear"/>
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.