Icons in a blade

In a widget I pass some html into my calendar, and I want to use heroicons that comes out the box, but currently I cant get the icon to show...
($day->work_type === 'remote' ? '<x-filament::icon icon="heroicon-o-home" class="h-5 w-5 text-gray-500 dark:text-gray-400" />' : '') .
($day->work_type === 'office' ? '<x-filament::icon icon="heroicon-o-office-building" class="h-5 w-5 text-gray-500 dark:text-gray-400" />' : '') .
($day->work_type === 'remote' ? '<x-filament::icon icon="heroicon-o-home" class="h-5 w-5 text-gray-500 dark:text-gray-400" />' : '') .
($day->work_type === 'office' ? '<x-filament::icon icon="heroicon-o-office-building" class="h-5 w-5 text-gray-500 dark:text-gray-400" />' : '') .
Solution:
Btw. you could just use the svg() helper if you just need to icon: {{ svg('iconoir-flask-solid', ['h-5 w-5']) }}
Jump to solution
3 Replies
Dennis Koch
Dennis Koch2w ago
You need some Blade::render() around this components. Otherwise you are just outputting them as strings
Solution
Dennis Koch
Dennis Koch2w ago
Btw. you could just use the svg() helper if you just need to icon: {{ svg('iconoir-flask-solid', ['h-5 w-5']) }}
Jamie Cee
Jamie CeeOP2w ago
Ill give them a go tomorrow, thank you 🙂

Did you find this page helpful?