Skip to main content
Copy for LLM

Table

A flexible table component with sub-components for head, body, foot, row, th, and td. Supports striped rows, hoverable rows, compact density, sortable columns, and horizontal scroll on narrow screens.

Wrap your rows in the table.* sub-components — not in raw <thead> / <tbody> / <tr> / <td> HTML. <x-wirekit::table> only styles the outer <table> element. Padding, row dividers, stripe + hover wiring, and sticky-header support live on the sub-components. Dropping plain HTML inside compiles cleanly and renders without errors — but produces a visually-broken table with flush-to-border content and no row separators. The component prints a console.warn in debug mode when it detects plain <thead> / <tbody> / <tr> / <th> / <td> descendants, a raw row around sub-component cells included; a table nested in a cell has rows of its own and is left out. Production stays silent. As a safety net, raw <td> / <th> cells inside <x-wirekit::table> now receive the same readable cell padding the table.td sub-component uses — so a raw table is no longer cramped flush-to-border even before you migrate it to the sub-components.

Basic Usage

Simple table
Name Role Balance
Jane Doe Administrator €1,250.00
John Smith Editor €840.00

Aligning a column

align on a table.th and on each table.td of its column sets where the column's text stands. start and end follow the direction of the page: a column of figures with align="end" stands at the right on an English page and at the left on an Arabic or Hebrew one, where the line ends. left and right name a physical side whatever the direction, and center centers. Without align a cell starts its text where the line starts.

Muted or smaller text in a cell

intent and size on a table.td set the color and the size of the cell's text, with the values a text takes: intent="muted" for a value that steps back, such as a figure that is not there yet, and size="sm" for one that matters less than the rest of its row. The cell needs no text inside it for either, and a long list renders one component fewer in each such cell. A stand-in takes the same two props for its words.

A muted cell
Item Sold this week
Espresso beans, 1 kg 24
Oat milk, 1 l None yet

Variants

Variant flags on the parent <x-wirekit::table> cascade to all rows via data attributes — no need to configure each sub-component.

Striped Rows

Alternating row tint, useful for dense data.

Striped + hoverable + compact
Product SKU Stock
Keyboard KB-001 42
Mouse MS-014 128
Monitor MN-220 7

Variant flags compose freely — any combination of striped, hoverable, and compact works. Example:

<x-wirekit::table striped hoverable compact>...</x-wirekit::table>

Sortable Columns

WireKit tables support two sorting modes: Livewire (server-side) and Alpine (client-side). Both render the same clickable headers with direction indicators and proper ARIA attributes.

Add sortable to <x-wirekit::table.th> to render a clickable header with a direction indicator. The header wires up automatically: with alpine-sort on the table, clicks cycle direction (unsorted → ascending → descending → unsorted) and reorder rows client-side. With Livewire (next section), bind sort-direction and wire:click to drive sorting server-side.

Sortable headers (Alpine — interactive)
Alpha 2025-01-15 Active
Beta 2025-03-08 Draft
Gamma 2025-02-22 Active

Click any column header above to cycle through ascending → descending → unsorted. The component sets aria-sort="ascending|descending|none" automatically per the WAI-ARIA contract for assistive technologies.

Livewire Integration

In a Livewire component, bind sort-direction dynamically and pass the sort method call to sort-action. Unlike putting wire:click on the header cell itself, sort-action wraps the label in a real <button>, so the sort is operable by keyboard (WCAG 2.1.1) and gets a visible focus ring:

The <button> fills the header cell, so the whole cell is the click target and the padding is not a dead zone. That matters on touch: a button sized to its label alone is only as tall as one line of text, which is under the 24×24 minimum of WCAG 2.5.8. The cell keeps its original height — the padding moves onto the button rather than being added to it — and the focus ring is drawn inside the cell so the table's scroll container cannot clip it on the header row. On a coarse pointer, and inside an element with data-wk-touch, the button takes the 44px height every button takes there, so a header row worked by finger is as tall as its target.

<x-wirekit::table hoverable>
    <x-wirekit::table.head>
        <x-wirekit::table.row>
            @foreach(['name' => 'Name', 'email' => 'Email'] as $field => $label)
                <x-wirekit::table.th
                    sortable
                    :sort-direction="$sortField === $field ? $sortDir : null"
                    sort-action="sortBy('{{ $field }}')"
                >
                    {{ $label }}
                </x-wirekit::table.th>
            @endforeach
        </x-wirekit::table.row>
    </x-wirekit::table.head>
    <x-wirekit::table.body>
        @foreach($users as $user)
            <x-wirekit::table.row>
                <x-wirekit::table.td>{{ $user->name }}</x-wirekit::table.td>
                <x-wirekit::table.td>{{ $user->email }}</x-wirekit::table.td>
            </x-wirekit::table.row>
        @endforeach
    </x-wirekit::table.body>
</x-wirekit::table>

The component holds the sort. sortBy() is called from the browser, with whatever argument a request carries, and a public property takes any value the browser sets, so the column is checked against the ones the table offers before the query sees it:

<?php

namespace App\Livewire;

use App\Models\User;
use Livewire\Component;

class UserTable extends Component
{
    public string $sortField = 'name';

    public string $sortDir = 'asc';

    // 1. The columns a reader may sort by. A column name is never bound like a value.
    protected array $sortable = ['name', 'email'];

    public function sortBy(string $field): void
    {
        if (! in_array($field, $this->sortable, true)) {
            return;
        }

        $this->sortDir = $this->sortField === $field && $this->sortDir === 'asc' ? 'desc' : 'asc';
        $this->sortField = $field;
    }

    public function render()
    {
        // 2. Checked again here, because the browser can set the two properties directly
        $field = in_array($this->sortField, $this->sortable, true) ? $this->sortField : 'name';
        $dir = $this->sortDir === 'desc' ? 'desc' : 'asc';

        return view('livewire.user-table', [
            'users' => User::query()->orderBy($field, $dir)->get(),
        ]);
    }
}

Client-Side Sorting (Alpine)

For static or small tables that don't need a server round-trip, use the alpine-sort prop on the table and column on each sortable <th>. This enables fully client-side sorting powered by Alpine.js — no Livewire required.

<x-wirekit::table alpine-sort hoverable>
    <x-wirekit::table.head>
        <x-wirekit::table.row>
            <x-wirekit::table.th sortable column="name">Name</x-wirekit::table.th>
            <x-wirekit::table.th sortable column="role">Role</x-wirekit::table.th>
            <x-wirekit::table.th sortable column="balance" align="right">Balance</x-wirekit::table.th>
        </x-wirekit::table.row>
    </x-wirekit::table.head>
    <x-wirekit::table.body>
        <x-wirekit::table.row>
            <x-wirekit::table.td>Jane Doe</x-wirekit::table.td>
            <x-wirekit::table.td>Administrator</x-wirekit::table.td>
            <x-wirekit::table.td align="right" data-wk-sort-value="1250">€1,250.00</x-wirekit::table.td>
        </x-wirekit::table.row>
        <x-wirekit::table.row>
            <x-wirekit::table.td>John Smith</x-wirekit::table.td>
            <x-wirekit::table.td>Editor</x-wirekit::table.td>
            <x-wirekit::table.td align="right" data-wk-sort-value="840">€840.00</x-wirekit::table.td>
        </x-wirekit::table.row>
        <x-wirekit::table.row>
            <x-wirekit::table.td>Alice Lee</x-wirekit::table.td>
            <x-wirekit::table.td>Viewer</x-wirekit::table.td>
            <x-wirekit::table.td align="right" data-wk-sort-value="2100">€2,100.00</x-wirekit::table.td>
        </x-wirekit::table.row>
    </x-wirekit::table.body>
</x-wirekit::table>

How it works:

  • Clicking a column header cycles through: unsorted → ascending → descending → unsorted
  • The sort component reads cell values from data-wk-sort-value (if present) or falls back to the cell's text content
  • Numeric values are compared numerically; strings are compared in the application's locale (German sorts "Ä" with "A", Swedish after "Z"), with numbers inside text in natural order ("Item 9" before "Item 10")
  • The original row order is preserved and restored when sorting is cleared
  • aria-sort is updated dynamically via Alpine bindings

When to use data-wk-sort-value: Use it when the display value differs from the sort value — for example, formatted currencies (€1,250.00 displays but 1250 sorts), dates, or values with units. If the text content is already sortable (plain text, plain numbers), you can omit it.

Alpine sorting reads a cell's text the way the page's reader reads it: as a number in the application's locale first, and in the machine spelling when the locale could not have written it. A column showing 12.345 or 1.234,56 on a German page, or 1 234,56 on a French one, sorts numerically without a data-wk-sort-value. German formatting never writes 1.5 or 0.125, because a group has three digits and the first one does not start with a zero, so those stay one and a half and an eighth. An ISO date is no number at all and sorts chronologically as text.

A data-wk-sort-value is read in the machine spelling first. On a page whose locale groups digits with a period, a raw value such as 12.345 meaning twelve point three four five belongs there, not in the cell's text, where the reader sees twelve thousand.

Searching the Rows

<x-wirekit::table.search> is a search field that shortens the rows of a table in the browser as the reader types, with no request to the server. Give the table an id and point the field at it with for. A row stays when the text of its cells contains the query, whatever the case and the accents, so munchen finds München. When no row matches, the field says so beside itself, and a screen reader hears how many rows match once the typing pauses.

A duration such as "6 min 15 s" is text, and sorted as text "10 min" would come before "9 min". Sort it by its seconds with data-wk-sort-value, and leave it out of the search with data-wk-search-skip, so a query for 6 finds no row by its duration:

Search and sort the steps of a pipeline

No results

Browser tests shop-münchen 10 min 15 s
Static analysis billing 6 min 15 s
Unit tests shop-münchen 9 min 22 s
Deploy billing 48 s

Type munchen to keep the two steps of shop-münchen, then sort the median: "9 min 22 s" comes before "10 min 15 s".

What a row is found by:

  • the text of its cells, each cell with data-wk-search-skip left out. Leave out a column of numbers or of buttons, whose text would match nearly any query
  • or the text of data-wk-search on the row, which then replaces its cells. Use it to find a row by a name the table does not show, such as a former name
  • only the rows of this table, never those of a table nested in one of its cells. A row your page hides itself, with the hidden attribute, stays hidden and does not count
  • the details row under a record belongs to it: the record is found by its text as well, and the two show and hide together

Saying what is counted

A screen reader hears "3 results" once the typing pauses. Where a page has several searches, or the reader should know how many rows the table holds, found says what is counted and of how many: :count is the number of rows that match, :total the number of rows the field searches, and the form of the line follows :count. Pass it through your translations like any other text of your interface:

<x-wirekit::table.search
    for="pipeline-steps"
    label="Search steps"
    :found="__('{1} :count of :total steps matches the search.|[2,*] :count of :total steps match the search.')"
/>

With three of twelve steps left, a screen reader hears "3 of 12 steps match the search." When no row matches, it hears empty-text instead.

With sorting on the server

The field works on the rows the server sends, so it stands beside a Livewire sort as well. When the component renders the rows in a new order, the field applies the query again before the browser paints them, so a row the reader filtered out does not flash back:

<x-wirekit::stack gap="sm">
    <x-wirekit::table.search for="steps" label="Search steps" />

    <x-wirekit::table id="steps" hoverable>
        <x-wirekit::table.head>
            <x-wirekit::table.row>
                @foreach(['name' => 'Step', 'median' => 'Median'] as $field => $label)
                    <x-wirekit::table.th
                        sortable
                        :sort-direction="$sortField === $field ? $sortDir : null"
                        sort-action="sortBy('{{ $field }}')"
                    >
                        {{ $label }}
                    </x-wirekit::table.th>
                @endforeach
            </x-wirekit::table.row>
        </x-wirekit::table.head>
        <x-wirekit::table.body>
            @foreach($steps as $step)
                <x-wirekit::table.row wire:key="step-{{ $step->id }}">
                    <x-wirekit::table.td>{{ $step->name }}</x-wirekit::table.td>
                    <x-wirekit::table.td align="right" data-wk-search-skip>{{ $step->median_for_humans }}</x-wirekit::table.td>
                </x-wirekit::table.row>
            @endforeach
        </x-wirekit::table.body>
    </x-wirekit::table>
</x-wirekit::stack>

The query stays in the browser: a page that reloads starts with an empty field. Each change sends wirekit:table-search from the field, with query, matches and total in its detail, for a page that shows something of its own when nothing matches.

Searching on the server

A table that renders only its first rows, with a button for the next ones, holds rows the browser has not got, and a search in the browser cannot find them. Set server, and the application searches instead: the field binds a property of the Livewire component with wire:model, the component filters every row before it shortens the list, and it passes the counts of its answer as matches and total. The field hides no row itself then. It says the counts once the answer is rendered, as it does in the browser, and shows empty-text when matches is 0:

{{-- 1. The field binds the component's property and says the counts the component gives --}}
<x-wirekit::table.search
    for="steps"
    label="Search steps"
    server
    wire:model.live.debounce.300ms="search"
    :matches="$matchCount"
    :total="$stepCount"
/>

Fold the query and each row with WireKit::foldForSearch(), the rule the field folds by in the browser, so munchen finds München on the server as well:

<?php

namespace App\Livewire;

use Illuminate\Support\Collection;
use Livewire\Component;
use Pushery\WireKit\WireKit;

class PipelineSteps extends Component
{
    public string $search = '';

    public int $shown = 20;

    public function render()
    {
        $all = $this->steps();

        // 2. Fold the query and each row as the field folds them in the browser
        $needle = WireKit::foldForSearch(trim($this->search));
        $matches = $needle === ''
            ? $all
            : $all->filter(fn (array $step): bool => str_contains(WireKit::foldForSearch($step['name'].' '.$step['repository']), $needle));

        // 3. Shorten after filtering, so a row beyond the first ones is found as well
        return view('livewire.pipeline-steps', [
            'steps' => $matches->take($this->shown),
            'matchCount' => $matches->count(),
            'stepCount' => $all->count(),
        ]);
    }

    protected function steps(): Collection
    {
        return collect([
            ['name' => 'Browser tests', 'repository' => 'shop-münchen'],
            ['name' => 'Static analysis', 'repository' => 'billing'],
            ['name' => 'Unit tests', 'repository' => 'shop-münchen'],
            ['name' => 'Deploy', 'repository' => 'billing'],
        ]);
    }
}

found works the same way here, with :total filled from total.

Help for a Column

A column whose name needs explaining takes help on its head: the question mark a field shows beside its label, with the text in a tooltip on hover and on keyboard focus. It follows the head's align, and under a head turned with sideways it stands below the label. In a sortable head it stands beside the sort button rather than inside it, so a click on it opens the help and sorts nothing; the button then covers the head and its indicator rather than the whole cell.

Help in the heads of a sortable table
Travel 230.00
Office 48.50

The head stays named by its words, so a screen reader that reads the head with each cell does not read the help's name with it. help-id writes the text once more as a hidden description with that id, for the fields in the column's rows to list in their aria-describedby:

{{-- 1. The head explains the column once --}}
<x-wirekit::table.th help="The budget the expense is booked against." help-id="help-category">Category</x-wirekit::table.th>

{{-- 2. Each field of the column points at that explanation --}}
<x-wirekit::table.td>
    <x-wirekit::input name="category[]" aria-label="Category" aria-describedby="help-category" />
</x-wirekit::table.td>

A click on the question mark dispatches wirekit:field-help with the column's column as its name, as a field's help reports the field, for a page that explains a column at greater length. See Help beside the label for listening to it.

Reordering Rows

A list whose order the reader sets, like the images of a product or the steps of a checklist, takes Livewire's wire:sort on the body and wire:sort:item on each row. A table.reorder cell in each row then carries the handle a pointer drags and two arrow buttons for everyone else: nobody can drag with a keyboard or a screen reader, and anybody can press a button. The arrows call the same method a drop calls, so one method serves both:

Rows reordered by dragging or with the arrows
Order Image Role
Front view Main image
Side view Gallery
Detail of the clasp Gallery
// 1. Called by a drop and by both arrows: the row's key and its new position, from 0
public function moveImage(int $id, int $position): void
{
    // 2. The key comes from the browser: find it among this product's own images
    $image = $this->product->images()->findOrFail($id);

    // 3. Store its new position among them, then render the rows in that order
}

position and count disable the arrows that lead nowhere: the first row cannot move up, the last cannot move down. A keyboard stays where it was: after the server answers, the focus is back on the arrow that was pressed in the row's new place, or on the other one once the row has reached an end, so a row can be moved several places with repeated presses, also while the server is still answering the last one. label names the row in the arrows' names, "Move Front view up", which matters where the row's own cells do not say what it is. table.reorder-head heads the column for a screen reader and draws nothing.

The arrows are neutral icon buttons, ghost at size xs unless the cell says otherwise. arrow-surface and arrow-size take any surface and size a button takes, so an application whose icon buttons are soft draws its arrows the same way:

<x-wirekit::table.reorder :item="$image->id" :position="$loop->index" :count="$loop->count"
    action="moveImage" :label="$image->title" arrow-surface="soft" arrow-size="sm" />

For a list that is not a table, Reorder draws the same controls on an element any row can hold.

A drag reorders the rows in the browser before its request leaves, so the order on screen does not tell you whether the server has taken it. Each cell carries the position the server drew in data-wk-reorder-position: a test that waits for those to match the new order waits for the server's answer, not for the browser's guess.

Caption

Add a semantic <caption> to describe the table content for screen readers:

Table with caption
A list of active team members and their roles.
Name Role
Jane Doe Admin

A caption is at most as wide as the space the table stands in. Under a table that scrolls sideways, such as a wide comparison on a phone, its sentences break within what shows of the table, rather than at the width of the whole table, where the scroll area would cut them.

Keep column headers visible while scrolling long tables:

Sticky header
Name Role Balance
Alice Admin €500
Bob Editor €1,200
Carol Viewer €890
Dave Editor €340
Eve Admin €2,100
Frank Viewer €750
Grace Admin €3,400
Hank Editor €620
Ivy Viewer €1,050
Jack Editor €980
Karen Admin €4,200
Leo Viewer €310

The responsive wrapper gets a bounded height and overflow-y-auto when sticky-header is enabled, and the bound is what makes the sticky heading work at all: the wrapper already scrolls horizontally, which makes it a scroll container on both axes — a heading with no height limit above it therefore measures itself against a box that never scrolls vertically, and never sticks.

The pinned head tells the wrapper how much of its top it covers, so a field, a link or a button in a row that takes the focus on the way up comes to rest below the head rather than under it.

The default bound is 24rem. Set sticky-header-max to any CSS length when that is the wrong one — a viewport-relative value is usually what a table of unknown length wants, because the limit then simply never applies to a short table:

{{-- 1. A five-row table never reaches 70vh, so it keeps its natural height and reserves nothing. --}}
{{-- 2. A thirty-row table stops at 70vh and its head stays put while the body scrolls. --}}
<x-wirekit::table sticky-header sticky-header-max="70vh">
    {{-- The table's head and rows --}}
</x-wirekit::table>

The bound reaches the element as an inline max-height, not as a utility class — so it takes any CSS length exactly as written, sticky-header-max="calc(100vh - 4rem)" included, with nothing to escape and nothing for your Tailwind build to have to see first.

Sticky First Column

Set sticky-column to freeze the first column against the start edge while the rest of the table scrolls horizontally — ideal for wide tables where the first column is the row's identity (a name, a date). The edge is logical rather than physical, so under dir="rtl" the column holds the right-hand side without a second rule. The frozen column keeps a solid background so the scrolling cells don't show through, in the color of its row: on a striped or a hoverable table the frozen cell takes the row's stripe and the shade under the pointer, and inside a card the card's surface. The lines between the rows run through the frozen column as they run beside it. Pair it with sticky-header to freeze the leading top corner too.

Frozen first column
Region Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec Total
North region €12,400 €11,800 €13,200 €12,900 €14,100 €13,800 €15,200 €14,600 €15,900 €16,300 €15,600 €18,200 €174,000
South region €9,200 €8,800 €9,600 €10,500 €11,300 €10,900 €12,100 €11,700 €12,400 €12,900 €12,100 €14,500 €136,000
East region €7,600 €7,200 €8,100 €8,400 €9,000 €8,700 €9,500 €9,100 €9,800 €10,200 €9,700 €11,800 €109,100
West region €10,800 €10,300 €11,200 €11,600 €12,400 €12,000 €13,100 €12,700 €13,500 €14,000 €13,300 €15,900 €150,800

Only below a breakpoint

sticky-column on its own gives the table its natural width at every size, so its cells never wrap to fit the box: a frozen column needs something to scroll past. A table that needs the frozen column only on a phone can say so instead. sticky-column-below takes a breakpoint and freezes the first column below it; from that width up the table fills its box again and wraps its cells, rather than scrolling sideways past a column it does not need to hold:

<x-wirekit::table sticky-column-below="lg">…</x-wirekit::table>

The prop turns the frozen column on by itself, so sticky-column is not needed alongside it. The breakpoints are the ones your Tailwind theme defines: sm, md, lg, xl and 2xl.

A table the component did not render, such as one your Markdown pipeline produced, gets the same behavior from the attribute data-wk-sticky-column-below="lg". Its rules ship in the stylesheet, so they use Tailwind's default breakpoint widths rather than your theme's. See attribute hooks.

Below the breakpoint that attribute also gives the table its natural width, like sticky-column does. A Markdown table with a sentence in a cell then becomes as wide as that sentence on one line. Add data-wk-sticky-column-fit to freeze the first column only and keep the table at the width your own CSS gives it, so its cells wrap into the box, and give the frozen column a floor with --size-wk-table-sticky-column-min:

<!-- 1. Frozen below md, wrapping into its box, first column at least 6rem wide -->
<table data-wk-sticky-column-below="md" data-wk-sticky-column-fit style="--size-wk-table-sticky-column-min: 6rem">…</table>

The frozen cell paints the page background, so the columns that scroll under it stay hidden. A Markdown table whose rows paint their own background, stripes for instance, hands that color to the frozen cell by setting --wk-sticky-column-bg on the row, as the attribute hooks show.

Long labels in the frozen column

The frozen column wraps instead of taking over the width. Its cells are capped at --size-wk-table-sticky-column-max, which is min(40vw, 16rem) by default, so on a phone a long label breaks onto a second line and the columns next to it stay in view. A table with room to spare gives the column its natural width, and nothing wraps.

Frozen column with long labels
Feature Starter Team Enterprise
Projects you can create 3 Unlimited Unlimited
Storage for uploaded files 5 GB 100 GB 1 TB
Single sign-on through your identity provider Not included Not included Included
Support from a named contact Not included By email By phone and email

To set a different cap for one table, set the token on that table:

<x-wirekit::table sticky-column style="--size-wk-table-sticky-column-max: 12rem">
    {{-- … --}}
</x-wirekit::table>

The columns beside it

The columns that scroll are capped as well, at the room beside the frozen column: the table's width less the frozen column's cap. A longer value wraps, so on a phone the first column beside the frozen one is seen whole, and each of the others can be scrolled fully into view. Short values stay on one line, and a header keeps its column as wide as its text.

A tighter cap goes in --size-wk-table-sticky-cell-max, for instance to show two narrow plans beside the frozen column instead of one:

<x-wirekit::table sticky-column-below="sm" style="--size-wk-table-sticky-cell-max: 8rem">
    {{-- … --}}
</x-wirekit::table>

The token only ever tightens: the room beside the frozen column stays the widest a column can get.

Use <x-wirekit::table.foot> for totals, summaries, or pagination rows:

Table with footer
Product Qty Price
WireKit Pro License 2 €198.00
Priority Support 1 €49.00
Starter Kit 1 €79.00
Total €326.00

Row headers

headerScope="row" makes the first cell of a row its header, so a screen reader names the record when it reads the cells beside it (WCAG 1.3.1). A row header takes the text color of the row and wraps like a cell, and it keeps the size and weight of a column head. Where the header is a value of its row, a product name or a budget, variant="cell" gives it the size and weight of the cells beside it:

Row headers that read as values of their row
Product Stock Value
Mechanical keyboard 42 €5,418.00
Wireless mouse 118 €4,602.00
Monitor stand 9 €531.00

variant changes the type alone: align, hideBelow and the scope still do what they say. A font size or weight of your own in class replaces the head's, with or without the variant, so class="font-normal" gives a row header the regular weight rather than leaving it to the order of the two utilities in the stylesheet.

Responsive Behavior

By default the table is wrapped in a horizontal-scroll container with WireKit's themed scrollbar. Disable with :responsive="false" if you handle overflow yourself.

The container scrolls sideways only, so a vertical swipe or mouse wheel that starts on a row scrolls the page. With sticky-header it also scrolls vertically, within the height sticky-header-max sets.

<x-wirekit::table :responsive="false">...</x-wirekit::table>

A responsive table says it scrolls before you touch it. A soft shadow appears at whichever inline edge has more table behind it, and disappears when you reach that end — so a reader on a phone, where there is no scrollbar until a drag is already underway, can see that the row continues instead of taking the cut-off column for the last one.

Nothing to switch on: it comes with responsive. It is driven by two one-pixel sentinels and an IntersectionObserver, so a hint is painted exactly while there is somewhere to scroll to — not on a timer, and not statically like a mask, which would dim the last column even once you had reached it. The pair is named for the start and end of the line rather than left and right, so it follows the reading direction: in a right-to-left document the hints sit on the other side.

The hint is a visual cue only. The scroll container itself carries tabindex="0" and a focus ring, so it is reachable and operable by keyboard whether or not the shadow is visible. Pass tableLabel to also make it a named screen-reader landmark — see Accessibility.

A printed table fits the sheet as far as its words allow. Paper cannot scroll sideways, so on paper the column headers wrap between words, as the cells do, and a table with a sticky first column takes the sheet's width. The same holds for any other table on the page. Words stay whole, and every column keeps at least its longest word and its padding, so a table with more columns than that leaves room for prints the columns that fit, and nothing on the sheet says that more follow: a table of fourteen columns of figures does not fit a portrait A4 sheet. Choose the columns a printout carries with hide-below: on paper the width of the sheet counts as the width of the window, so a column that steps aside on a phone stays off a portrait sheet as well. A landscape sheet holds more of them; to print a page on one, give that page this rule:

@page {
    size: landscape;
}

Stacked Rows on Small Screens

stack-below lays the rows out as cards below a breakpoint, so a table with more columns than a phone has room for does not scroll sideways: each row of the body stands as a card, and each cell as a line that starts with the name of its column. The cell that holds the row's actions stands as the card's footer, and by default that is a cell with align="right". From the breakpoint up the table is a table again.

Endpoints that stack below md
Endpoint Events Status Actions
hooks.example.com/orders/created order.created Active
hooks.example.com/payments payment.failed Paused

Each cell takes the name of its column from the header above it, by WireKit's script, which also names the rows a Livewire update adds. label on a cell names it directly, and is what a page without WireKit's full script, such as one on the core bundle, gives its cells:

<x-wirekit::table.td label="Endpoint">{{ $endpoint->url }}</x-wirekit::table.td>

A value in a card keeps the width of its words, so a badge stays a pill and a short code stays short. It ends at its column at the latest: a name longer than the column breaks inside it rather than running past the card.

A long name in a stacked cell
Variable Value Environment
BILLING_INVOICE_REMINDER_DAYS_BEFORE_DUE 7 Production
APP_DEBUG false Production

The table stays a table for a screen reader: it keeps its header row, out of sight, and writes its roles out, since some browsers stop exposing a table whose cells are laid out as cards. Where a browser takes an alternative text for generated content, the name before each value is for the eye alone, and a screen reader hears the column's header once, as it does in the table.

A column that hide-below or hide-below-container takes off the screen stays off the cards while it is hidden, so a footer whose other cells give way on a phone stands as one line with its total. A details row stands as a card only at the widths it is shown at. The table below stacks below md of its own width, and so do the first two cells of its footer: at 390 the footer is its total with its name.

A hidden class of your own on a cell or a row, with or without a variant such as max-sm:hidden, does not take it off the cards: the card sets the display of its rows and cells itself, and that comes after your utilities. Hide a column with the props above. Hide a single cell or row with x-show, or with the hidden attribute, which Tailwind's base styles keep hidden in every layout. Both hold on the cards.

A footer that writes only its total on a phone
Area Interval Requests
Europe Hourly 1,284
North America Daily 912
In all 2,196

Sorting a stacked table

A table that sorts keeps its sort below the breakpoint. Its header row leaves the eye, and the heads that sort stand above the cards as a row of their buttons, each with the direction it shows on a desktop, so a reader on a phone sorts by the same columns. A head that does not sort stays out of sight for a screen reader, and a control in it, such as a column's help, leaves the tab order with it. It works the same with alpine-sort and with sort-action.

Members that sort as cards
Role
Jane Doe Administrator €1,250.00
John Smith Editor €840.00
Alice Lee Viewer €2,100.00

Figures aligned to the end

A cell with align="end" or align="right" becomes the card's footer because a row's actions sit at its end. A column of figures is aligned to the end for another reason, and :actions="false" keeps its cells as lines named by their column. A cell aligned to the end that carries a label of its own keeps that name too. actions makes any cell the footer, wherever it is aligned.

Figures that keep their names below md
Step Runs Failures Median
Build 1,284 12 3m 40s
Deploy 412 3 1m 05s

A cell of several parts

A cell can hold more than one part: two lines of text, or a badge with a date after it. Stacked, each part stands beside the cell's name, one under the other, in the order you write them. Parts that belong on one line go in one element of their own, such as a <span>.

Cells of two parts below md
Address Reason
203.0.113.7

Repeated sign-in attempts

Twelve attempts in four minutes

198.51.100.24 Paused since 12 March

A long value under its name

A stacked cell sets its name in the first two fifths of the card and its value beside it in the other three. That suits a status, a code or a time. A value of running text, an error message or a description, breaks into many short lines in three fifths of a phone's card. label-above sets the name on a line of its own above the value, which then takes the card's whole width; wider than the table, the cell stays one line of the row.

An error message under its name below md
Endpoint Status Error
orders.example.com/hooks 500 cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received
stock.example.com/events 410 The receiver answered that the endpoint is gone; deliveries to it have stopped.

Stacking by the width of the table

stack-below asks the window, and beside a sidebar or in one column of a page that is the wrong thing to measure: a table in the narrow column of a wide window scrolls sideways while the window is wider than the breakpoint. stack-below-container asks the width of the table instead, on the container scale a column's hide-below-container reads (sm to 5xl, where 3xl is 48rem of table). The rows stack as soon as the table has less room than that, at any window width. The table below stacks below md, 28rem of table: it shows its columns at the wider sizes of the preview, and its rows stack at 390.

A table that stacks in a narrow column
Size Chest Waist Length
S 96 cm 82 cm 70 cm
M 102 cm 88 cm 72 cm

The table measures its own frame, so it needs that frame: stack-below-container works on a responsive table, the default, and is reported on one with :responsive="false". The two props may stand together, and the rows stack when either asks for it.

A table whose frame something measures takes its width from the page, not from its rows. stack-below-container, a column, a details row or a stand-in on the container scale, a caption and a frozen column all measure it. Such a table fills the column it stands in, and inside a flex row it needs a width of its own, such as flex-1 or w-full. A table that none of these measure takes its width from its columns wherever it stands.

Hiding a Column on Small Screens

A column that matters less can step aside on a narrow screen. Give hide-below a breakpoint on the column's header and on each of its cells, and below that width the column is gone. Its values need a place to go, or they leave the screen with it: a table.stand-in in a neighboring cell shows exactly where the column is hidden, so each value is on screen once at every width. Here the last activity moves under the name below sm, which the preview shows at 390:

The last-active column steps aside below sm, and its value moves under the name
Name Last active Roles
Ada Lovelace Last active 3 minutes ago 3 minutes ago Admin
Grace Hopper Last active yesterday Yesterday Editor

The breakpoints are the ones your Tailwind theme defines: sm, md, lg, xl and 2xl. Put the prop on the header and on every cell of the column. A header hidden without its cells would leave each value in that column under the wrong heading, and cells hidden without their header would do the same the other way round. Give the stand-in the same breakpoint, and let its text name the column, since a screen reader reads it under the header of the cell it stands in.

A stand-in takes intent and size with the values of text, as a cell does, so words that only need to be muted or smaller need no text inside it. The stand-ins above set both.

A column hidden without a stand-in or a details row takes its values off a small screen, so hide one that way only when nobody there needs them.

A sticky-column table freezes the first cell of every row, so hide a later column there. Hiding the first one leaves nothing frozen below the breakpoint.

When the window is the wrong thing to measure

hide-below asks the viewport, and beside a sidebar that is the wrong question. In an app shell the sidebar steps beside the content at lg, so the table has less room at a 1024px viewport than at 768px, and a column that appears at md appears exactly where the table has least room.

hide-below-container asks the table instead:

<x-wirekit::table>
    <thead>
        <tr>
            <x-wirekit::table.th>Name</x-wirekit::table.th>
            <x-wirekit::table.th hide-below-container="3xl">Terms accepted</x-wirekit::table.th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <x-wirekit::table.td>Ada</x-wirekit::table.td>
            <x-wirekit::table.td hide-below-container="3xl">Yes</x-wirekit::table.td>
        </tr>
    </tbody>
</x-wirekit::table>

The two props do not share a scale, and the names overlap. Tailwind's container sizes are their own ladder, so hide-below-container="3xl" is 48rem of table while hide-below="md" is 48rem of window — and hide-below-container="md" is 28rem of table, not 48rem of anything. Both spellings are valid, so passing the one you meant for the other prop cannot be caught for you. Pick the question first: does this column depend on the size of the screen, or on the space the table has?

Give the header and every cell of the column the same value, exactly as with hide-below — a header hidden without its cells puts every value under the wrong heading. The two can be combined: a column may be hidden on a phone and when the table itself is narrow.

Your own classes on an element in a cell can ask the same question. The table's container is named wk-table, so @max-lg/wk-table:hidden hides that element while the table is narrower than 32rem, and @max-lg/wk-table:[overflow-wrap:anywhere] lets a long name break there, whatever the window's width. A variant of that container in a cell makes the table's frame a container on its own, as hide-below-container does. A variant without a name, such as @max-lg:hidden, asks the nearest container instead, and inside the table that is the table's frame whenever the frame is one. To ask a container of your own around the table, give it a name and write that name into the variant.

Giving way only in a wide window

A table may scroll sideways in its own frame on a phone and still have to fit on a desk. hide-below-container-from sets the window width from which hide-below-container applies: below it the column keeps its place. In a neighboring cell, table.stand-in holds what stands in for the column, and it shows exactly where the column gives way, so the value is on screen once at every width:

{{-- 1. The column gives way in a window of 80rem and up, while the table is narrower than 64rem. --}}
<x-wirekit::table.th hide-below-container="5xl" hide-below-container-from="xl">Fulfillment</x-wirekit::table.th>

{{-- 2. Each of its cells takes the same two values. --}}
<x-wirekit::table.td hide-below-container="5xl" hide-below-container-from="xl">
    <x-wirekit::badge>Shipped</x-wirekit::badge>
</x-wirekit::table.td>

{{-- 3. The neighboring cell carries the stand-in, with the column's two values. --}}
<x-wirekit::table.td>
    <x-wirekit::badge intent="success">Paid</x-wirekit::badge>
    <x-wirekit::table.stand-in below-container="5xl" from="xl">
        <x-wirekit::visually-hidden>Fulfillment:</x-wirekit::visually-hidden>
        <x-wirekit::badge>Shipped</x-wirekit::badge>
    </x-wirekit::table.stand-in>
</x-wirekit::table.td>

The preview below asks a smaller window, sm, because a preview is drawn in a frame narrower than xl. At 768 the table is narrower than 3xl in a window wider than sm, so the shipping state moves beside the payment; at 390 the window is narrower than sm, and the column keeps its place:

A column that gives way in a narrow table, from a window width up
Order Payment Fulfillment
#1042 Paid Fulfillment: Shipped Shipped
#1043 Pending Fulfillment: Open Open

A stand-in is read under the header of the cell it stands in, so give it its column's name for a screen reader, as the visually hidden "Fulfillment:" does above. It makes that cell as wide as both values, which suits a short one such as a badge; for a longer value, a details row keeps the cell as narrow as it was. table.stand-in takes below instead, for a column hidden with hide-below, but not both: a column hidden by either width shows again only where both are wide, which a stand-in cannot express.

A long column name

A column header stays on one line, which is right for the usual one-word head. It is wrong when the name is long and the content is not — a permissions table with a column per legal document holds those columns as wide as their names while the checkboxes under them need a fraction of it, and the table runs past its frame rather than the heads taking two lines.

wrap on the header lets it break:

<x-wirekit::table.th wrap>Data protection agreement</x-wirekit::table.th>

It breaks inside a word where there is no space to break at, which is what a long compound noun needs. A header without wrap is unchanged, so no existing table moves.

Over a column of numbers that breaks too eagerly: nothing in the column is wider than a digit, so a head allowed to break anywhere falls to that width. wrap="words" breaks only between words and evens the lines up, so the longest word is the narrowest the head gets:

{{-- 1. A band head over a number column: "bis" / "10 %", never "bis 10" / "%" --}}
<x-wirekit::table.th wrap="words" align="right">bis 10 %</x-wirekit::table.th>

The evening-up is text-wrap: balance, which newer browsers support. Where it is missing the head still breaks between its words and only the last line is not balanced.

Neither helps when the columns beside a long head hold a mark each and another column takes all the room that is left: whatever width the heads give up goes to that column, and with wrap they fall to one letter per line. sideways turns the label on its side instead. It reads from bottom to top on one line, so the column is as wide as one line of text in any language, and the row grows to the longest name:

Consent columns beside a name that takes the rest
Name Terms of service Privacy policy Cookie policy Accessibility statement
Ada Lovelace
Grace Hopper
Alan Turing

Every head in a row that holds a turned one stands on the row's floor, so the upright heads line up with the turned labels and the data starts right under all of them. A sortable head keeps its sort indicator upright under the label, where its arrow still points the way the order runs. A turned head stays on one line, so it takes precedence over wrap.

Keeping what the hidden column held

Hiding a column takes its value off the screen with it. That is right when the column is secondary, and wrong when it is the thing the reader came for — a permissions table that hides its consent column on a phone has hidden the answer.

Squeezing it into a neighboring cell is the usual response and it is a trap: a cell that holds two values needs the width of both, so the table runs past its frame at exactly the size that made you hide the column.

details is a second row under the record, spanning the columns that are left. Here the role moves into it while the table is narrower than md, which the preview shows at 390:

The role moves under the record while the table is narrow
Name Role Last seen
Ada Lovelace Owner Yesterday
Role: Owner
Grace Hopper Viewer In March
Role: Viewer

Four props, and only the first is required:

prop what it does
details-below-container show the row while the table is narrower than this — the mirror of hide-below-container
details-below the same against the window, mirroring hide-below. Both may be given
details-colspan how many columns the row spans. Count the columns that are still visible at that width
details-for the id of the record's row header, written to headers so a screen reader is told which record this row continues

details-below-container must carry the same breakpoint as the columns you hid. The two are opposites of one another — the column disappears below it, the row appears there — so a mismatch leaves a width where the value is shown twice, or at which it is shown nowhere at all.

Under Livewire, the key is derived

Give the record row a wire:key and the details row takes <that key>-details on its own. There is nothing to declare: a details row belongs to exactly one record.

<x-wirekit::table.row wire:key="user-{{ $user->id }}" details-colspan="2">
    …
    <x-slot:details>{{ $user->role }}</x-slot:details>
</x-wirekit::table.row>

Without a key on the record, Livewire pairs the details row by position. That is correct only while every record emits one, always immediately behind itself — and the moment one record has details and its neighbor does not, the pairing goes wrong silently: both rows still render, so nothing fails, and one record's details sit under another record's name.

Key the record and the problem cannot arise. Nothing else from the record row crosses to the details row — its class would overwrite the details classes if it did.

Leave both ladders off and the row is shown at every width. That is a legitimate layout — a permanent sub-line per record — and not a mistake, so it is not warned about.

Three things are handled for you, and each one is a way this looks finished and is not:

  • the rule between a record and its own details is dropped, because they are one record. The rule between one record and the next moves to the details row, so the table still reads as rows.
  • when the details row is hidden, the last record does not keep a rule with nothing under it. A hidden row is still a row as far as the separator is concerned.
  • stripes count records, not rows, so a details row does not shift every stripe below it onto the wrong record. The details row wears the tint of the record it belongs to.

Keeping a control in view while the table scrolls sideways

A row that spans every column begins at the start edge of the table, not of the visible area. On a wide table that means a control in such a row scrolls out of sight exactly when somebody is reading the far columns.

Nothing needs to be added for this. Cap the control to the table's own container and pin it:

<x-wirekit::table.row>
    <x-wirekit::table.td colspan="15">
        <span style="max-width: 100cqi; position: sticky; inset-inline-start: 0; display: inline-block;">
            <x-wirekit::button size="xs">Release</x-wirekit::button>
        </span>
    </x-wirekit::table.td>
</x-wirekit::table.row>

Both halves are required, and each one alone does nothing. The cap without the pin changes no position; the pin without the cap has nothing to pin, because the content is already as wide as the table. On a phone over a wide table, the pair holds the control at the edge, and either half alone leaves it off screen.

100cqi is the inline size of the table's own container, which is the visible width rather than the scrolled one — so the cap is what turns inset-inline-start: 0 into "the edge of what you can see", on the left in a left-to-right page and on the right in a right-to-left one.

position: sticky on the cell does not work here, although it is what sticky-column uses for a first column. A cell spanning every column is already the width of the table, so pinning it pins nothing.

There is no preview for this one: what it does only becomes visible while scrolling, and a static render shows the same picture either way.

Width & Layout

Tables fill their parent width. For narrow tables, constrain the wrapper:

<div class="max-w-2xl">
    <x-wirekit::table>…</x-wirekit::table>
</div>

When responsive is enabled (default), the table scrolls horizontally on small screens. Column widths can be controlled via Tailwind on <x-wirekit::table.th>:

<x-wirekit::table.th class="w-16">ID</x-wirekit::table.th>
<x-wirekit::table.th class="w-1/2">Name</x-wirekit::table.th>

As wide as its columns

A table of a few narrow columns does not need the width of the page. fit stands it as wide as its columns, at most as wide as the space it is in. Wider than that, it does what it does without fit: the columns wrap their words until they can wrap no more, and a table with a frozen first column keeps its columns at their width and scrolls sideways, with the shadows at its edges.

A stock grid as wide as its columns
Color S M L XL
Navy 4 12 9 0
Chalk 7 3 15 2

Set fit rather than wrapping the table in an element that sizes itself by its content, such as w-fit, w-max, inline-block, or a flex or grid column as wide as its content. A responsive table measures its columns against a container, and a container takes no width from what it holds, so in such a wrapper the table is left with no width at all. With fit the container stays as wide as the space, so a column that steps aside below a table width measures the space as it does without fit. Below a stack-below breakpoint, where the rows stand as cards, the table fills the space.

Rendering Many Rows

A table of a few hundred rows is mostly its cells, and Blade spends its time around each of them rather than on their markup. With livewire/blaze installed, WireKit lets it compile the cells into PHP functions:

// config/wirekit.php
'blaze' => [
    'table' => true,
    'text' => true,
],

wirekit.blaze.table compiles the cells and their stand-ins, wirekit.blaze.text the text component a cell often holds. The table and its rows stay Blade components, which is how a cell finds the table it belongs to, in a table inside a cell too. Each renders the same markup as under Blade. Run php artisan view:clear after turning a switch on or off, so the compiled views are written again.

Blaze skips the view composers of the views it compiles, and WireKit does their work inside the cell, so nothing else in your application changes. Without Blaze installed, the switches do nothing.

WireKit is tested with Blaze 1.0.21 and later. With Blaze 1.0.10, a compiled cell that holds a button throws while it renders, so update Blaze before you turn wirekit.blaze.table on.

Props

<x-wirekit::table>

Prop Type Default Description
striped bool false Alternating row backgrounds
hoverable bool false Row highlight on hover
compact bool false Reduced vertical padding
responsive bool true Wrap in horizontal-scroll container
fit bool false As wide as its columns, at most as wide as the space — see As wide as its columns
stickyHeader bool false Sticky column headers while scrolling
stickyHeaderMax string '24rem' How tall the body may get before it scrolls, when stickyHeader is on. Any CSS length, delivered as an inline max-height — calc(100vh - 4rem) works as written, with nothing to escape
stickyColumn bool false Freeze the first column while the rest scrolls horizontally. A long label in the frozen column wraps at --size-wk-table-sticky-column-max
stackBelow string|null null Below a breakpoint, 'sm', 'md', 'lg', 'xl' or '2xl', lay each row of the body out as a card and each cell as a line named by its column — see Stacked Rows on Small Screens
stackBelowContainer string|null null The same below a width of the table, 'sm' to '5xl' on the container scale; a responsive table only — see Stacking by the width of the table
stickyColumnBelow string|null null Freeze the first column only below a breakpoint: 'sm', 'md', 'lg', 'xl' or '2xl'. From that width up the table fills its box and wraps its cells. Turns the frozen column on by itself — see Only below a breakpoint
alpineSort bool false Enable client-side Alpine sorting (no Livewire needed)
tableLabel string|null null Accessible name for the focusable scroll wrapper, and the switch that makes it a screen-reader landmark. Without it the wrapper stays keyboard-reachable and simply is not a landmark — see Accessibility
scope string|null null Scoped personalization name

<x-wirekit::table.th>

Prop Type Default Description
sortable bool false Render as clickable sortable header
sortDirection string|null null 'asc', 'desc', or null (Livewire mode)
column string|null null Column identifier for Alpine sort mode (pairs with alpine-sort on table). Without alpine-sort the head reads as unsorted.
sortAction string|null null Livewire-sort mode: the wire:click method call (e.g. "sortBy('name')") that wraps the header label in a keyboard-operable <button> (WCAG 2.1.1 — the cursor-pointer cell alone is mouse-only).
align string 'start' 'start', 'center' or 'end', which follow the direction of the page, or 'left' and 'right' for a physical side. See Aligning a column
headerScope string 'col' The <th scope> attribute: 'col' (default), 'row' for a per-row header cell (WCAG 1.3.1), 'colgroup', 'rowgroup'. Distinct from scope below, which is theming.
hideBelow string|null null Hide the column below a breakpoint: 'sm', 'md', 'lg', 'xl' or '2xl'. Every table.td of the column takes the same value — see Hiding a Column on Small Screens
wrap bool|'words' false Let a long header take a second line instead of holding its column as wide as its longest word. true breaks anywhere, 'words' only between words and balances the lines — see A long column name
sideways bool false Turn the label on its side, reading from bottom to top on one line: a column of marks beside a column that takes the rest keeps one line of width — see A long column name
variant string 'header' The type of the head: 'header', the size and weight of a column head, or 'cell', the size and weight of a body cell, for a row header that is a value of its row — see Row headers. A font size or weight in class replaces the head's own either way
help string|null null An explanation of the column, shown in a tooltip from a question mark beside the head. Beside a sort button, never inside it — see Help for a Column
helpId string|null null The id of a hidden copy of help, which a field in each row of the column lists in its aria-describedby
hideBelowContainer string|null null Hide the column below a width of the table: 'sm', 'md', 'lg', 'xl', '2xl', '3xl', '4xl' or '5xl' on Tailwind's container ladder. Every table.td of the column takes the same value — see When the window is the wrong thing to measure
hideBelowContainerFrom string|null null The window width from which hideBelowContainer applies: 'sm', 'md', 'lg', 'xl' or '2xl'. Below it the column keeps its place. Every table.td of the column takes the same value — see Giving way only in a wide window
scope string|null null Scoped personalization name

<x-wirekit::table.td>

Prop Type Default Description
align string 'start' 'start', 'center' or 'end', which follow the direction of the page, or 'left' and 'right' for a physical side. See Aligning a column
hideBelow string|null null Hide the cell below a breakpoint. Use the same value as the column's table.th, so header and cells go away together
label string|null null The name of the cell's column where the table stacks its rows (stack-below). Unset, the header above the column names it
actions bool|null null Where the table stacks its rows, the cell holds the row's actions and stands as the card's footer, without a name. Unset, a cell with align="right" and no label of its own does; false keeps a cell aligned to the end as a named line — see Figures aligned to the end
labelAbove bool false Where the table stacks its rows, the cell's name stands on a line of its own above the value, which takes the card's whole width: for running text, such as an error message. The cell with the row's actions has no name — see A long value under its name
hideBelowContainer string|null null Hide the cell below a width of the table. Use the same value as the column's table.th — see When the window is the wrong thing to measure
hideBelowContainerFrom string|null null The window width from which the cell's hideBelowContainer applies. Use the same value as the column's table.th — see Giving way only in a wide window
intent string 'default' The color of the cell's text: 'default', 'muted', 'subtle', 'accent', 'success', 'warning', 'danger' or 'inherit', which writes no color, as on a text — see Muted or smaller text in a cell
size string 'base' The size of the cell's text: 'xs', 'sm', 'base', 'lg', 'xl' or 'inherit', which writes no size, as on a text
scope string|null null Scoped personalization name

<x-wirekit::table.reorder>

Prop Type Default Description
item mixed null The row's key, the value its row carries in wire:sort:item
position int 0 Where the row stands, counted from 0
count int|null null How many rows there are. Without it the down arrow is never disabled
action string null The Livewire method the body's wire:sort calls. The arrows call it with the row's key and its new position
label string|null null What the row is, for the arrows' names — see Reordering Rows
arrowSurface string 'ghost' The arrows' button surface: filled, outline, soft, ghost or link
arrowSize string 'xs' The arrows' button size: any size a button takes
scope string|null null Scoped personalization name

<x-wirekit::table.reorder-head>

Prop Type Default Description
scope string|null null Scoped personalization name

<x-wirekit::table.stand-in>

Prop Type Default Description
belowContainer string|null null The hideBelowContainer of the column it stands in for. The stand-in shows while the table is narrower than this
from string|null null The column's hideBelowContainerFrom. The stand-in shows only from this window width up. Needs belowContainer
below string|null null The hideBelow of a column that gives way to the window instead. The stand-in shows below this breakpoint. Not with belowContainer
intent string|null null The color of its words, with the values of text: default, muted, subtle, accent, success, warning, danger or inherit. Unset, the words take the cell's
size string|null null The size of its words, with the values of text: xs, sm, base, lg, xl or inherit. Unset, the words take the cell's
scope string|null null Scoped personalization name

It renders a span with its slot, which stands inline beside the cell's own content — see Giving way only in a wide window.

<x-wirekit::table.caption>

Prop Type Default Description
scope string|null null Scoped personalization name

<x-wirekit::table.search>

Prop Type Default Description
for string — The id of the table whose rows the field shortens, or of an element around it
label string|null "Search…" The field's accessible name, and its placeholder unless placeholder names another
placeholder string|null the label The text inside the empty field
empty-text string|null "No results" What the field says beside itself, and announces, when no row matches
found string|null "{1} :count result|[2,*] :count results" What a screen reader hears when rows match: a pluralizable line with :count, the rows that match, and :total, the rows the field searches. See Saying what is counted
server bool false The application filters the rows: bind the field with wire:model and pass matches and total. The field hides no row itself and says the counts of the answer. See Searching on the server
matches int|null null With server: how many rows match the query, counted over every row, not only those the page renders
total int|null null With server: how many rows the application searched
scope string|null null Scoped personalization name
Event Detail When
wirekit:table-search { query, matches, total } The reader changed the query; with server, once the answer to it is rendered

<x-wirekit::table.head>

Prop Type Default Description
variant string 'filled' 'filled' paints the subtle header fill; 'flush' drops it
scope string|null null Scoped personalization name

flush removes the fill and nothing else — the bottom divider and the sticky-header rules stay, because those are what keep a head readable while the body scrolls under it. Reach for it when the head sits on a surface that already provides its own contrast; leave it alone otherwise.

<x-wirekit::table.body>, .foot

Only scope is available. All styling is driven by the parent table's data attributes.

<x-wirekit::table.row>

Prop Type Default Description
details slot — a second row under this one, spanning the columns left after a hide-below* took some away. Filling it is what makes the row exist
details-below-container string null sm | md | lg | xl | 2xl | 3xl | 4xl | 5xl — show the details row while the table is narrower than this
details-below string null sm | md | lg | xl | 2xl — the same against the window. May be combined with the line above
details-colspan int null how many columns the details row spans
details-for string null the id of the record's row header, written to the details cell's headers
scope string null theming scope

See Keeping what the hidden column held for what the component handles on your behalf — the separator, the last row, and the stripe.

Accessibility

  • <th> elements set scope="col" automatically — screen readers announce column headers as context for each cell

  • Sortable columns expose aria-sort="ascending" / "descending" / "none" — see WAI-ARIA Authoring Practices: Sortable Table

  • A sortable header renders its label inside a <button> that fills the cell, or covers the head and its indicator where a column's help stands beside it, so the sort is operable with Tab + Enter / Space and not only with a pointer (WCAG 2.1.1). That applies to both sort modes — alpine-sort with column, and Livewire sorting with sort-action. aria-sort stays on the <th>, where the column semantics are

  • table.search is a native search field named by its label, and it names the table it filters with aria-controls. The number of matching rows reaches a screen reader through a polite status region a moment after the typing pauses, so a word is announced once rather than once per letter (WCAG 4.1.3). The sentence for no match beside the field is for the eye, and is not read twice

  • The sort direction icon is aria-hidden="true" (decorative — the aria-sort value is the semantic signal)

  • Hover tints rely on color, so avoid conveying row state through hover alone — use explicit status indicators (badges, icons with labels)

  • With stack-below, the table writes role="table", rowgroup, row, columnheader and cell out, so it stays a table for a screen reader while its rows are laid out as cards, and its header row stays in the document, out of sight

  • The responsive scroll wrapper carries tabindex="0" and a focus ring in every configuration, so a keyboard user can pan to off-screen columns (WCAG 2.1.1)

  • The wrapper becomes a screen-reader landmark only when you name it with tableLabel. It then gets role="region" and that name and appears in the landmark list. Without one it stays a plain focusable scroller — because role="region" plus a name is a landmark, and every table on a page falling back to one built-in name would be a set of landmarks announcing the same thing, which axe reports as landmark-unique. Name it after the data:

    <x-wirekit::table table-label="Customer list">
        {{-- … --}}
    </x-wirekit::table>
    

Keyboard Interaction

Key Action
Tab Move focus through column-header sort buttons (when sortable) and row action controls
Enter / Space (on a sort button) Toggle the sort direction for that column

Cell content is delegated to the browser's native table semantics; assistive tech announces row / column relationships from the <th> / <td> markup.

Pitfalls

  • Don't put a <x-wirekit::dropdown> inside a <table> cell without testing. Portal-rendered overlays escape the cell; ensure z-index and click-outside-to-close work in your specific layout.
  • Don't use HTML <table> for layout. WCAG 1.3.1 — <x-wirekit::table> adds row/column ARIA semantics; misuse for layout is a screen-reader trap.
  • Don't give a head sortable and column in a table without alpine-sort. Nothing sorts there, so the head reads as unsorted, its button does nothing, and the table reports it in the log while APP_DEBUG is on. Add alpine-sort to the table, or sort through Livewire with sort-action.
  • Give a measured table a width when its parent sizes to its content. A stack-below-container, a column, details row or stand-in on the container scale, a caption, a frozen column, container units in its cells and a variant of its container such as @max-lg/wk-table:hidden each read the width of the table's frame, which makes the frame a size container, and a size container takes no width from what it holds. In a parent that shrinks to fit its content, a flex column with align-items: center or an inline-block for instance, there is then no space to measure, and the table collapses to nothing with no error. Set width: 100% on the table or on the card around it, and constrain the wrapper if it should be narrower. A table that nothing measures takes its width from its columns there.

Design Tokens

Element Token
Table background inherits from parent
Head background --color-wk-bg-subtle
Foot background --color-wk-bg-subtle
Row divider --color-wk-border-subtle
Head divider --color-wk-border
Striped row tint --color-wk-bg-subtle
Hover row tint --color-wk-bg-active
Cell padding --padding-wk-x-md / --padding-wk-y-md
Compact cell padding --padding-wk-y-sm
Text color --color-wk-text
Header text color --color-wk-text-muted
Frozen column cap (sticky-column) --size-wk-table-sticky-column-max
Scrolling column cap (sticky-column) --size-wk-table-sticky-cell-max

Customization

Override defaults without publishing views via config/wirekit.php:

'components' => [
    'table' => [
        'striped' => true,
        'hoverable' => true,
        'compact' => false,
        'responsive' => true,
    ],
],

Further Reading

Updated in WireKit v2.75.0 (2026-12-01)

Was this page helpful?

Thank you for your feedback!

Voting requires cookies or local storage. What we store