Skip to main content
You are currently viewing the documentation for Filament 2.x, which is a previous version of Filament.Looking for the current stable version? Visit the 5.x documentation.
Badge columns render a colored badge with the cellโ€™s contents:

Customizing the color

Badges may have a color. It may be either primary, secondary, success, warning or danger:
You may instead activate a color using a callback, accepting the cellโ€™s $state:
Or dynamically calculate the color based on the $record and / or $state:

Adding an icon

Badges may also have an icon:
Alternatively, you may conditionally display an icon using a closure:
Or dynamically calculate the icon based on the $record and / or $state:
You may set the position of an icon using iconPosition():

Formatting the text

All formatting options available for text columns are also available for badge columns.

Allowing the text to be copied to the clipboard

You may make the text copyable, such that clicking on the cell copies the text to the clipboard, and optionally specify a custom confirmation message and duration in milliseconds. This feature only works when SSL is enabled for the app.
Filament uses tooltips to display the copy message in the admin panel. If you want to use the copyable feature outside of the admin panel, make sure you have @ryangjchandler/alpine-tooltip installed in your app.

Customizing the text that is copied to the clipboard

You can customize the text that gets copied to the clipboard using the `copyableState() method:
In this function, you can access the whole table row with $record: