Basics
The Icon component is used for rendering icons.
You can create an Icon using the static method make()
of the Icon
class.
make(string $icon, int $size = 5, string|Color $color = '', ?string $path = null)
$icon
- the name of the icon or HTML (if custom mode is used),
$size
- size,
$color
- color,
$path
- the path to the directory where the Blade templates for icons are located.
use MoonShine\UI\Components\Icon; Icon::make('users');
<x-moonshine::icon icon="users" />
Custom Output
Example with passing an HTML icon:
Icon::make(svg('path-to-icon-pack')->toHtml())->custom(),