Introduction
Icon columns render an icon representing the column’s state:
use Filament\Tables\Columns\IconColumn;
use Filament\Support\Icons\Heroicon;
IconColumn::make('status')
->icon(fn (string $state): Heroicon => match ($state) {
'draft' => Heroicon::OutlinedPencil,
'reviewing' => Heroicon::OutlinedClock,
'published' => Heroicon::OutlinedCheckCircle,
})
Customizing the color
You can set the icon color:
IconColumn::make('status')
->color('success')
Or use a closure for dynamic colors:
IconColumn::make('status')
->color(fn (string $state): string => match ($state) {
'draft' => 'info',
'reviewing' => 'warning',
'published' => 'success',
default => 'gray',
})
The icon color or a closure that returns a color.
Customizing the size
You can customize the icon size:
use Filament\Support\Enums\IconSize;
IconColumn::make('status')
->size(IconSize::Medium)
Available sizes: ExtraSmall, Small, Medium, Large, ExtraLarge, TwoExtraLarge.
size
IconSize | string | Closure
default:"IconSize::Large"
The icon size.
Boolean columns
Icon columns can display boolean values with check/X icons:
IconColumn::make('is_featured')
->boolean()
Filament automatically detects boolean casts on your model.
condition
bool | Closure
default:"true"
Whether to treat as a boolean column.
Customizing boolean icons
You can customize the icons for true and false states:
use Filament\Support\Icons\Heroicon;
IconColumn::make('is_featured')
->boolean()
->trueIcon(Heroicon::OutlinedCheckBadge)
->falseIcon(Heroicon::OutlinedXMark)
icon
string | BackedEnum | Htmlable | Closure | false
The icon to display. Pass false to hide the icon.
Customizing boolean colors
Customize the colors for true and false states:
IconColumn::make('is_featured')
->boolean()
->trueColor('info')
->falseColor('warning')
color
string | array | Closure
default:"'success' for true, 'danger' for false"
The icon color.
Wrapping icons
Allow multiple icons to wrap to multiple lines:
IconColumn::make('icon')
->wrap()
Multiple icons
When the column state is an array, you can display multiple icons:
IconColumn::make('features')
->listWithLineBreaks()
condition
bool | Closure
default:"true"
Whether to display icons on separate lines.