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']);- actionsLabel:"Actions"
- bulkActions:[]
- data:[{"name":"Ada Lovelace","verified":"1"},{"name":"Alan Turing","verified":"0"}]
- emptyLabel:"No results"
- endpoint:null
- filters:[]
- layout:null
- lazy:null
- pagination:{"currentPage":null,"from":1,"hasMore":false,"lastPage":null,"mode":"none","nextPage":null,"perPage":null,"to":2,"total":2}
- resizableColumns:null
- resizeIndicator:false
- state:{"filters":[],"page":1,"perPage":25,"sorts":[],"tableFilters":[]}
- striped:null
- badge:null
- copyable:false
- date:null
- link:null
- multiple:null
- colors:["gray","green"]
- icon:null
- icons:["minus","check"]
->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-inIconenum).->colors([value => color])tints the icon per value, with the same palette as a badge.
use Lattice\Lattice\Core\Enums\Icon;
IconColumn::make('priority') ->icons(['high' => Icon::ArrowUp, 'low' => Icon::ArrowDown]) ->colors(['high' => 'red', 'low' => 'gray']);