© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
dansing

How to render icon in blade template using existing filament way?

Here I'm rendering a Star icon from heroicons

@for ($i = 1; $i <= 5; $i++)
                <div
                    @mouseover="hoverRating = {{ $i }}; rating = -1;"
                    @mouseout="hoverRating = -1; rating = state"
                    @click="state = {{ $i }}"
                >
                    <svg xmlns="http://www.w3.org/2000/svg" x-bind:fill="(hoverRating !== -1 && {{ $i }} <= hoverRating) || ({{ $i }} <= rating) ? 'yellow' : 'white'" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
                        <path stroke-linecap="round" stroke-linejoin="round" d="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" />
                    </svg>
                </div>
            @endfor
@for ($i = 1; $i <= 5; $i++)
                <div
                    @mouseover="hoverRating = {{ $i }}; rating = -1;"
                    @mouseout="hoverRating = -1; rating = state"
                    @click="state = {{ $i }}"
                >
                    <svg xmlns="http://www.w3.org/2000/svg" x-bind:fill="(hoverRating !== -1 && {{ $i }} <= hoverRating) || ({{ $i }} <= rating) ? 'yellow' : 'white'" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
                        <path stroke-linecap="round" stroke-linejoin="round" d="M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" />
                    </svg>
                </div>
            @endfor
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

render filament table in blade
FilamentFFilament / ❓┊help
2y ago
render a filament table using blade
FilamentFFilament / ❓┊help
3y ago
Using Filament grid in blade view
FilamentFFilament / ❓┊help
2y ago
Passing array to Blade::render for email template
FilamentFFilament / ❓┊help
3y ago