Search docs

Jump to any table example

Discord—

Shadcn Table with Split Detail Panel

Open a record beside the table to read and edit it, then move on to the next one without losing your filter, sort or place in the list. Shown as a support ticket queue.

$ npx shadcn add https://www.shad-table.dev/r/split-detail-table.json

Open a ticket by its subject.

TicketStatus
TCK-1053 · Grace Mensah, Akwaaba Foods
OpenUrgent8m ago
TCK-1040 · Lena Fischer, Brightwave
OpenUrgent40m ago
TCK-1060 · Felix Wagner, Holzwerk
OpenHigh1h ago
TCK-1044 · Daniel Ortiz, Shipfast
OpenHigh1h ago
TCK-1056 · Kofi Asante, Tro Tro
OpenHigh1h ago
TCK-1049 · Emma Novak, Pilot Coffee
OpenNormal2h ago
TCK-1041 · Marcus Webb, Northwind
OpenUrgent3h ago
TCK-1042 · Aiko Tanaka, Kumo Labs
OpenHigh4h ago

1–8 of 13

How it works

1.The panel pushes the table, it does not cover it

The table and the panel sit side by side in one frame. Opening a ticket widens the panel and narrows the table, which hides its least useful columns to make room. The table scrolls in its own area, so its filter, sort, page and scroll position stay exactly as they were. On phones the panel covers the table instead.

src/components/split-detail/ticket-panel.tsx
open
? 'visible w-full border-l transition-[width] sm:w-[26rem]'
: 'invisible w-0 transition-[width,visibility]'

2.The open row stays put, even when it stops matching

The open ticket is highlighted and marked aria-current. If you set an open ticket to Pending while looking at Open tickets, it stays in the list until you close it, with a note saying so, so the row you are working on never vanishes from under you. It also keeps its place in the sort: editing it stamps it as just updated, but it sorts by the values it had when opened.

src/components/split-detail/columns.tsx
filterFn: (row, _id, { view, keep }: StatusFilter) =>
row.original.id === keep || inView(row.original, view),

3.Review one ticket after another

Clicking another subject replaces the panel. The panel’s previous and next buttons walk the filtered, sorted list across pages, turning the table’s page when needed. That is why the table instance lives in the demo: the panel needs its order.

src/components/split-detail/index.tsx
const order = table.getPrePaginationRowModel().rows.map((r) => r.id)
function go(id: string) {
setOpenId(id)
setPagination((p) => ({ ...p, pageIndex: Math.floor(order.indexOf(id) / PAGE_SIZE) }))
}

4.Edit in place

Status, priority and assignee are shadcn Selects that update the row as you change them. Replying adds to the conversation and moves an open ticket to Pending, since it now waits on the customer. Editing never resets the page, because autoResetPageIndex is off.

src/components/split-detail/tickets.ts
status: t.status === 'open' ? 'pending' : t.status,

5.Focus goes where you expect

Opening a ticket from the table moves focus to its subject in the panel, so screen readers announce it. Previous and next keep focus on the button you pressed. Escape or the close button returns focus to the subject in the table that opened the panel.

src/components/split-detail/ticket-panel.tsx
document.querySelector(`[data-ticket-id="${lastId.current}"]`)?.focus()