F
Filament3mo ago
Abi

How can I show an icon as the label for a Table Builder column

I want to show an image or a blade icon as the label for a Table Builder column. Is there any way to do this? I am using an Icon Column and here is what I have tried so far:
Tables\Columns\IconColumn::make('email_verified')
->label(fn()=> Blade::render('<x-heroicon-s-envelope class="h-4 w-4 text-gray-900" />'))
->alignCenter()
->tooltip(fn ($record) => $record->email_verified_at ? 'Email Verified' : 'Email Not Verified')
->getStateUsing(fn ($record) => isset($record->email_verified_at))
->boolean(),
Tables\Columns\IconColumn::make('email_verified')
->label(fn()=> Blade::render('<x-heroicon-s-envelope class="h-4 w-4 text-gray-900" />'))
->alignCenter()
->tooltip(fn ($record) => $record->email_verified_at ? 'Email Verified' : 'Email Not Verified')
->getStateUsing(fn ($record) => isset($record->email_verified_at))
->boolean(),
Solution:
nvm, figured it out
->label(fn()=> new HtmlString(Blade::render('<x-heroicon-s-envelope class="h-4 w-4 text-gray-900" />')))
->label(fn()=> new HtmlString(Blade::render('<x-heroicon-s-envelope class="h-4 w-4 text-gray-900" />')))
...
Jump to solution
1 Reply
Solution
Abi
Abi3mo ago
nvm, figured it out
->label(fn()=> new HtmlString(Blade::render('<x-heroicon-s-envelope class="h-4 w-4 text-gray-900" />')))
->label(fn()=> new HtmlString(Blade::render('<x-heroicon-s-envelope class="h-4 w-4 text-gray-900" />')))