Interactive examples
Explore InertiaX through real interfaces and the Laravel and React code behind them.
A complete table from your Laravel model.
$users = InertiaX::table('users') ->data(User::class) ->autoColumns(); return Inertia::render('Users/Index', [ $users, ]);
Columns and field types are inferred from your model.
12 users
Enable JavaScript to use the interactive tables. You can alsoread the quick start.
Search, filter, sort, select, and control visible columns.
Declare columns, add a role filter, and enable row selection.
InertiaX::table('users') ->data(User::class) ->addColumns([ NumberColumn::make('id') ->numberCast('int')->visible(false), TextColumn::make('name') ->searchable()->sortable(), TextColumn::make('email')->toggleable(), TextColumn::make('role'), DateColumn::make('joined_on', 'Joined') ->format('M j')->toggleable(), ]) ->addFilter(SelectFilter::make('role')->options([ 'admin' => 'admin', 'analyst' => 'analyst', 'engineer' => 'engineer', ])) ->selection() ->pageSize(5);
Format totals, statuses, and dates with custom cells.
Laravel formats statuses and dates; React formats totals.
InertiaX::table('orders') ->data(Order::class) ->addColumns([ NumberColumn::make('id') ->numberCast('int')->visible(false), TextColumn::make('reference', 'Order') ->searchable(), TextColumn::make('customer'), NumberColumn::make('total')->type('demo/money'), BadgeColumn::make('status')->variant([ 'paid' => 'success', 'processing' => 'warning', 'refunded' => 'secondary', 'failed' => 'danger', ]), DateColumn::make('placed_at', 'Placed') ->format('M j')->sortable(), ]) ->addFilter(SelectFilter::make('status')->options([ 'paid' => 'paid', 'processing' => 'processing', 'refunded' => 'refunded', 'failed' => 'failed', ])) ->pageSize(5);
Use the same table experience with in-memory data.
Pass a collection or an array and declare its columns.
InertiaX::table('activity') ->data(collect($recentEvents)) ->addColumns([ TextColumn::make('id')->visible(false), TextColumn::make('actor')->searchable(), TextColumn::make('action'), TextColumn::make('target')->copyable(), DateTimeColumn::make('occurred_at', 'Time') ->format('H:i')->sortable(), ]) ->pageSize(5);