Download the PHP package zondicons/blade-bridge without Composer
On this page you can find all versions of the php package zondicons/blade-bridge. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download zondicons/blade-bridge
More information about zondicons/blade-bridge
Files in zondicons/blade-bridge
Package blade-bridge
Short Description Easily integrate the Zondicons icon set into your Laravel applications.
License MIT
Informations about the package blade-bridge
Zondicons Blade Bridge
Easily use Zondicons in your Blade templates, either as inline SVG or using SVG sprites.
Installation
Getting started
In Laravel 5.5 the service provider will automatically get registered. In older versions of the framework just add the Zondicons service provider in config/app.php
file:
Publish the Zondicons config file:
If you want to use the sprite sheet instead of rendering every icon inline, make sure you render the hidden sprite sheet somewhere at the end of any layouts that are going to use icons using the svg_spritesheet()
helper:
Configuration
Inside config/zondicons.php
you can specify whether you'd like icons to be rendered inline by default, or to reference the icon from the sprite sheet:
You can also specify any default CSS classes you'd like to be applied to your icons using the class
option:
You can specify multiple classes by separating them with a space, just like you would in an HTML class attribute:
Basic Usage
To insert a Zondicon in your template, simply use the @icon
Blade directive, passing the name of the icon and optionally any additional classes:
To add additional attributes to the rendered SVG tag, pass an associative array as the third parameter:
If you have attributes to declare but no additional class, you can pass an associative array as the second parameter instead:
If you'd like to override the default class name, specify a class in the attributes array:
If you'd like to add an attribute that needs no value, just specify it without a key:
If you'd like, you can use the svg_icon
helper directly to expose a fluent syntax for setting icon attributes:
You can force an icon to reference the sprite sheet even if you are rendering inline by default by using the fluent syntax and chaining the sprite
method:
Similarly, you can force an icon to render inline even if you are using sprites by default by chaining the inline
method: