Table
Columns
Wire Table provides 13 column types. All share the same base column API for labels, visibility, authorization, sorting, formatting, and inline editing.
Wire Table provides 13 column types. All share the same base column API for labels, visibility, authorization, sorting, formatting, and inline editing.
Table of Contents
- Shared Column API
- Relation Paths & Dot Notation
- TextColumn
- BadgeColumn
- BooleanColumn
- IconColumn
- ImageColumn
- ButtonColumn
- ToggleColumn
- SelectColumn
- TextInputColumn
- StackedColumn
- SplitColumn
- PollColumn
- Column-Level Filtering
- Inline Editing
- Patterns & Recipes
Shared Column API
Every column inherits these capabilities from the base Column class.
Factory & Identity
Column::make(string $name) // static factory — $name is dot-notation path->label(string|Closure $label) // display label in <th> (auto-generated from name)->getName(): string // get column name->getLabel(): string // get resolved label
Sorting
->sortable(bool|Closure $sortable = true)->isSortable(): bool // Custom sort logic->sortUsing(Closure $fn)
TextColumn::make('full_name') ->sortable() ->sortUsing(function (Builder $query, string $direction) { $query->orderBy('last_name', $direction) ->orderBy('first_name', $direction); })
Searching
->searchable(bool|array $searchable = true)->isSearchable(): bool // Explicit DB columns to search (when column name is virtual)->searchColumns(array $columns) // Custom search logic->searchUsing(Closure $fn) // Get resolved search columns->getSearchColumns(): array
// Search across multiple DB columnsTextColumn::make('user') ->searchable() ->searchColumns(['first_name', 'last_name', 'email']) // Custom search logicTextColumn::make('full_name') ->searchable() ->searchUsing(function (Builder $query, string $search) { $query->where(DB::raw("CONCAT(first_name, ' ', last_name)"), 'like', "%{$search}%"); })
Visibility & Toggleability
->hidden(bool|Closure $hidden = true) // hide column->visible(bool|Closure $visible = true) // show column (inverse of hidden)->isHidden(): bool // User-toggleable (column picker)->toggleable(bool $toggleable = true) // Permission-based->permission(string $permission) // visible only if user has permission->visible(Closure $fn) // custom visibility callback
Responsive Breakpoints
->visibleFrom(string $breakpoint) // hidden below this breakpoint->hiddenFrom(string $breakpoint) // hidden from this breakpoint up->onlyOnMobile() // visible only on mobile (<md)->onlyOnDesktop() // visible only on desktop (≥lg)->onlyOnTabletAndUp() // visible from md up->onlyOnLargeScreens() // visible from xl up
TextColumn::make('phone') ->visibleFrom('md') // hidden on mobile, visible from md TextColumn::make('notes') ->onlyOnLargeScreens() // only visible on xl+
Responsive Display Variants
// Custom render for mobile vs desktop->mobileDisplayUsing(Closure $fn)->desktopDisplayUsing(Closure $fn)->hasResponsiveDisplay(): bool
TextColumn::make('user') ->mobileDisplayUsing(fn ($record) => $record->name) ->desktopDisplayUsing(fn ($record) => "{$record->name} <{$record->email}>")
Value Formatting
->formatStateUsing(Closure $fn) // transform value for display->displayUsing(Closure $fn) // alias for formatStateUsing->default(mixed $value) // value when state is null->placeholder(string $text) // text shown when value is null/empty->limit(int $chars) // truncate to N characters->words(int $words) // truncate to N words->prefix(string $prefix) // prepend text->suffix(string $suffix) // append text->html(bool $html = true) // render value as raw HTML->wrap(bool $wrap = true) // allow text wrapping (default: nowrap)
TextColumn::make('price') ->prefix('$') ->suffix(' USD') ->placeholder('N/A') TextColumn::make('bio') ->limit(100) ->tooltip(fn ($record) => $record->bio) // show full on hover TextColumn::make('content') ->html() ->wrap() ->limit(200)