© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•9mo ago•
5 replies
FabioB

Tooltip on Enums?

Hi!
Trying to add a tooltip to a (table) TextColumn.

1. My Enum looks like this:

<?php

namespace App\Enums;

use ...
use ...
use ...

enum TicketPriority: string implements HasLabel, HasColor, HasIcon
{
case Low = 'low';
case Medium = 'medium';
case High = 'high';
case Urgent = 'urgent';

.....
public function getTooltip(): ?string
{
return match ($this) {
self::Low => ('Longer description 1 here ....'),
self::Medium =>
('Longer description 2 here ....'),
self::High => ('Longer description 3 here ....'),
self::Urgent =>
('Longer description 4 here ....'),
};
}
....


2. On my resource im trying to get:
...
IconColumn::make('priority')
->label('') //-narrower column
->icon(fn($state) => $state->getIcon()) //-Picks and shows the icon
->size(IconColumnSize::Medium)
->tooltip(fn($state) => $state->getTooltip()),
...

3. I get the following error:

Call to a member function getTooltip() on null . The same for getLabel() ....

4. However, if I do something like this:
...
IconColumn::make('priority')
->label('')
->icon(fn($state) => $state->getIcon())
->size(IconColumnSize::Medium)
->tooltip(fn($state) => dd($state->getTooltip())), <------------
ˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆˆ
...

5. I actually get:
"Longer description 1 here ...." // app/Filament/Resources/TicketResource.php:116

6. What am I missing??
Thanks!!!!
Solution
The error happens because $state is null in some rows
IconColumn::make('priority')
    ->label('')
    ->icon(fn($state) => $state?->getIcon())
    ->size(IconColumnSize::Medium)
   ->tooltip(fn($state) => $state?->getTooltip())
IconColumn::make('priority')
    ->label('')
    ->icon(fn($state) => $state?->getIcon())
    ->size(IconColumnSize::Medium)
   ->tooltip(fn($state) => $state?->getTooltip())
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

tooltip
FilamentFFilament / ❓┊help
2y ago
tooltip
FilamentFFilament / ❓┊help
3y ago
Tooltip on table column header
FilamentFFilament / ❓┊help
2y ago
chart() tooltip
FilamentFFilament / ❓┊help
2y ago