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:null
- bulkActions:[]
- data:[{"name":"Ada Lovelace","verified":"1"},{"name":"Alan Turing","verified":"0"}]
- emptyLabel:null
- endpoint:null
- filters:[]
- layout:null
- lazy:false
- pagination:{"currentPage":null,"from":1,"hasMore":false,"lastPage":null,"mode":"none","nextPage":null,"perPage":null,"to":2,"total":2}
- perPageOptions:[]
- pinnableColumns:false
- query:{"filters":[],"mode":null,"page":1,"perPage":25,"search":"","sorts":[],"tableFilterIndicators":[],"tableFilters":{}}
- resizableColumns:false
- resizeIndicator:false
- searchable:false
- striped:false
- toolbar:[]
- align:"start"
- badge:null
- copyable:false
- date:null
- filter:null
- hiddenByDefault:false
- label:"Name"
- link:null
- multiple:null
- options:[]
- pinned:null
- sortable:false
- toggleable:false
- width:"md"
- align:"start"
- colors:{"0":{"dark":null,"kind":"named","value":"gray"},"1":{"dark":null,"kind":"named","value":"green"}}
- filter:null
- hiddenByDefault:false
- icon:null
- icons:{"0":"minus","1":"check"}
- label:"Verified"
- options:[]
- pinned:null
- sortable:false
- toggleable:false
- width:"md"
->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 — a colour name (gray,red,orange,yellow,green,blue,purple, or the semanticdefault,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']);