How to use this with Blade Icons? #238
-
html()->icon('heroicon-o-square-2-stack')->class('size-5 fill-white text-white'), This is my public function icon(string $name): Element
{
return $this
->element('x-icon')
->attribute('name', $name);
} It does render fine, but it doesn't show the SVG. If I add the output of HTML manually, it get's parsed. |
Beta Was this translation helpful? Give feedback.
Answered by
francoism90
Jul 8, 2024
Replies: 1 comment
-
To answer my own question: public function icon(): mixed
{
return function (string $name, ?string $class = null, ?array $attributes = []): Div {
/** @var Div $this */
return $this->div(svg($name, $class, $attributes)); // you can also use span
};
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
francoism90
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To answer my own question: