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.jsonOpen a ticket by its subject.
| Ticket | Status | ||
|---|---|---|---|
TCK-1053 · Grace Mensah, Akwaaba Foods | Open | Urgent | 8m ago |
TCK-1040 · Lena Fischer, Brightwave | Open | Urgent | 40m ago |
TCK-1060 · Felix Wagner, Holzwerk | Open | High | 1h ago |
TCK-1044 · Daniel Ortiz, Shipfast | Open | High | 1h ago |
TCK-1056 · Kofi Asante, Tro Tro | Open | High | 1h ago |
TCK-1049 · Emma Novak, Pilot Coffee | Open | Normal | 2h ago |
TCK-1041 · Marcus Webb, Northwind | Open | Urgent | 3h ago |
TCK-1042 · Aiko Tanaka, Kumo Labs | Open | High | 4h 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.
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.
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.
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.
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.
document.querySelector(`[data-ticket-id="${lastId.current}"]`)?.focus()