Table
A responsive table with header, body, footer, and caption parts.
Usage
| Invoice | Status | Method | Amount |
|---|---|---|---|
| INV001 | Paid | Credit card | $250.00 |
| INV002 | Pending | PayPal | $150.00 |
| INV003 | Unpaid | Bank transfer | $350.00 |
| Total | $750.00 | ||
Composition
code
Table
├── TableCaption
├── TableHeader
│ └── TableRow / TableHead
├── TableBody
│ └── TableRow / TableCell
└── TableFooter
└── TableRow / TableCell
Recipes
Slate’s table is presentational — sort, filter, and pagination live in your Livewire (or controller) state. Compose the markup below.
Sortable column header
example.blade.php
<x-slate::table-head>
<button
type="button"
class="inline-flex items-center gap-1 font-medium"
wire:click="sortBy('email')"
>
Email
@if ($sort === 'email')
<span class="text-muted-foreground" aria-hidden="true">{{ $direction === 'asc' ? '↑' : '↓' }}</span>
<span class="sr-only">sorted {{ $direction }}</span>
@endif
</button>
</x-slate::table-head>
Filter + empty state
example.blade.php
<div class="mb-4">
<x-slate::input wire:model.live.debounce.300ms="search" placeholder="Filter…" />
</div>
@@if ($rows->isEmpty())
<x-slate::empty title="No results" description="Try a different search." />
@@else
<x-slate::table>
{{-- …rows… --}}
</x-slate::table>
@@endif
Pagination footer
Pair Pagination under the table; keep page size and query in Livewire.