© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
4 replies
urbycoz

How can I change the badge text in a textEntry?

I'm trying to use a TextEntry component in an Infolist to display a boolean in my database table. In the table, the value is stored as 1 or 0, but I'd really like to show a badge saying "active" or "inactive" instead.

TextEntry::make('isActive')
->label('Account Status')
->badge()
->color(fn (string $state): string => match ($state) {
'1' => 'success',
'0' => 'danger'
}),
Solution
you can use
formatStateUsing
formatStateUsing


but better to use
IconEntry
IconEntry
🙂
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

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

TextEntry roles badge translations
FilamentFFilament / ❓┊help
2y ago
How can I render the badge with only the icon (no text)?
FilamentFFilament / ❓┊help
14mo ago
How i can change color of text
FilamentFFilament / ❓┊help
3y ago
Can I change the default FileUpload Text?
FilamentFFilament / ❓┊help
2y ago