Skip to content

Filtering

Call filterable() to generate a filter for a column:

use InertiaX\Components\Table\Columns\TextColumn;
TextColumn::make('name')->filterable();

Automatic filters are enabled by default. InertiaX chooses the input from the column type.

Use the table’s filters() method for explicit inputs and labels:

use InertiaX\Components\Table\Filters\SelectFilter;
use InertiaX\Components\Table\Filters\TextFilter;
protected function filters(): array
{
return [
TextFilter::make('name')->defaultClause('contains'),
SelectFilter::make('status')->options([
'active' => 'Active',
'invited' => 'Invited',
]),
];
}

These keys refer to fields in the source. You can also call addFilter() on an inline table, or attach a filter to a column with filter(). An explicit filter replaces automatic inference for its key. Use autoFilters(false) to keep only explicit and attached filters.

SelectFilter::make('role')->options([
'admin' => 'Administrator',
'engineer' => 'Engineer',
])->multiple();

Use autoOptions(limit: 200) to discover distinct values from the source. If there are more options than the limit, the UI shows a notice. Increase the limit or supply explicit options when users need the full set.

A clause is a comparison such as “contains” or “equals”. Change the offered comparisons or the initial choice:

TextFilter::make('name')
->removeClause('not-contains')
->defaultClause('contains');

See Filter API for each input’s clause set and Custom filters for your own comparisons or inputs.

use InertiaX\Components\Table\Enums\FilterMode;
UsersTable::make('users')->data($users)->filterMode(FilterMode::Advanced);

Basic mode combines direct conditions with and. Advanced mode adds nested groups, or, and explicit comparison choices. The fluent method also accepts 'basic' or 'advanced'.

Basic single-value filters apply as users edit them; ranges wait for Apply range. Advanced filters stay in a draft until Apply filters. Clear applies an empty group immediately. Applied changes reset the page and use the search/filter request delay.