© 2026 Hedgehog Software, LLC

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

IconEntry not showing icon if value is null

I have an IconEntry that I want to use to display if something is ok or not. But if the value is null, it doesn't show up.
Here's a code example:
IconEntry::make('apple_id')
                            ->label('Apple login')
                            ->icon(fn (string $state): string => !empty($state) ? 'heroicon-o-check-circle' : 'heroicon-o-x-circle')
                            ->color(fn (string $state): string => !empty($state) ? 'success' : 'danger'),
IconEntry::make('apple_id')
                            ->label('Apple login')
                            ->icon(fn (string $state): string => !empty($state) ? 'heroicon-o-check-circle' : 'heroicon-o-x-circle')
                            ->color(fn (string $state): string => !empty($state) ? 'success' : 'danger'),


If it's null I want it to display the red x mark but it just isn't processed. Any workaround?
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

InfoList icon not showing when state is null
FilamentFFilament / ❓┊help
3y ago
Showing icon in Infolist TextEntry when the value is null
FilamentFFilament / ❓┊help
4mo ago
formatStateUsing not called if value is null
FilamentFFilament / ❓┊help
3y ago
DatePicker value if DB field is null
FilamentFFilament / ❓┊help
3y ago