Columns
Columns declare what each row shows. Create one with Column::make(), passing the key — the row
field it reads. Lattice ships a column type for each common value; this page covers the options every
column shares.
TextColumn::make('name'); // header "Name", reads $row['name']TextColumn::make('name')->label('Full name');Column types
Section titled “Column types”- Text — a value as text, with date, link, and badge modifiers.
- Number — a formatted number, right-aligned.
- Money — a currency amount.
- Boolean — a check or cross.
- Badge — a coloured pill.
- Icon — an icon, optionally per value.
- Image — an image or avatar.
- Stack — several columns stacked in one cell.
The options below extend the base Column, so they work on every type. The examples use TextColumn,
but the methods are identical everywhere.
The label defaults to the humanized key; override it with ->label(). Pass an empty string to render
a column with no header — useful for an avatar or icon column.
TextColumn::make('created_at')->label('Registered');Alignment
Section titled “Alignment”->align(ColumnAlign::Start|Center|End) sets the cell alignment. Text columns default to Start;
number and money columns default to End.
use Lattice\Lattice\Tables\Enums\ColumnAlign;
TextColumn::make('code')->align(ColumnAlign::Center);Every column carries a width hint the table uses to size its column. ->width() overrides the default
with a ColumnWidth case (Lattice\Lattice\Core\Enums\ColumnWidth —
Xs, Sm, Md, Lg, Xl).
use Lattice\Lattice\Core\Enums\ColumnWidth;
TextColumn::make('id')->width(ColumnWidth::Xs);TextColumn::make('description')->width(ColumnWidth::Xl);Toggleable
Section titled “Toggleable”->toggleable() lets viewers show or hide the column from a Columns menu in the table toolbar.
The menu appears as soon as at least one column opts in; columns without ->toggleable() stay pinned
and never appear in it. Pass hiddenByDefault: true to ship a column hidden — viewers can reveal it
when they need it.
TextColumn::make('name'); // pinned, always visibleTextColumn::make('sku')->toggleable(); // hide-able, shown by defaultNumberColumn::make('price')->toggleable();TextColumn::make('updated_at')->label('Updated') ->dateTime() ->toggleable(hiddenByDefault: true); // hide-able, starts hidden- actionsLabel:"Actions"
- bulkActions:[]
- data:[{"name":"Desk Lamp","price":"49.00","sku":"LAMP-1","updated_at":"2026-05-30 09:15:00"},{"name":"Office Chair","price":"189.00","sku":"CHAIR-2","updated_at":"2026-06-02 14:40:00"}]
- 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
- badge:null
- copyable:false
- date:null
- link:null
- multiple:null
- compact:false
- maximumFractionDigits:null
- minimumFractionDigits:null
- unit:null
- badge:null
- copyable:false
- date:{"dateStyle":"medium","timeStyle":"medium"}
- link:null
- multiple:null
Sortable and filterable
Section titled “Sortable and filterable”->sortable() and ->filterable() are capabilities a column opts into, not display options. They
add the sort control and the filter affordance to the header, and tell the data source to apply the
request’s sort and filter for that column. They are covered under
Sorting & pagination and Filtering.
TextColumn::make('name')->sortable()->filterable();