Skip to content

Icon column

IconColumn renders an icon instead of text — useful for a status or a boolean-like flag.

TextColumn::make('name')->label('Name');
IconColumn::make('verified')->label('Verified')
->icons(['1' => Icon::Check, '0' => Icon::Minus])
->colors(['1' => 'green', '0' => 'gray']);
  • ->icon('star') shows the same icon for every row.
  • ->icons([value => icon]) picks an icon per value — each key is a cell value, each icon a sprite name or a backed enum case (e.g. the built-in Icon enum).
  • ->colors([value => color]) tints the icon per value — a colour name (gray, red, orange, yellow, green, blue, purple, or the semantic default, muted, primary, success, info, warning, danger) or any CSS colour, same as a badge. Unmapped values render in the default icon colour.
use Lattice\Ui\Enums\Icon;
IconColumn::make('priority')
->icons(['high' => Icon::ArrowUp, 'low' => Icon::ArrowDown])
->colors(['high' => 'red', 'low' => 'gray']);