Master-Detail Table
shadcn-table-library/master-detail-tableFreeBlock
Expand a row to reveal a nested sub-table detail panel, rendered as a full-width row beneath the row that owns it.
Install it
npx shadcn@latest add https://shad-table.dev/r/master-detail-table.jsonSource
1'use client'23import type { ColumnDef } from '@tanstack/react-table'45export type OrderItem = {6 product: string7 qty: number8 price: number9}1011export type Order = {12 id: string13 customer: string14 date: string15 status: string16 total: number17 shippingAddress: string18 items: OrderItem[]19}2021export const currency = (value: number) =>22 value.toLocaleString('en-US', { style: 'currency', currency: 'USD' })2324export const columns: ColumnDef<Order>[] = [25 {26 accessorKey: 'id',27 header: 'Order',28 },29 {30 accessorKey: 'customer',31 header: 'Customer',32 },33 {34 accessorKey: 'date',35 header: 'Date',36 },37 {38 accessorKey: 'status',39 header: 'Status',40 },41 {42 accessorKey: 'total',43 header: 'Total',44 cell: ({ getValue }) => currency(getValue() as number),45 },46]
What it pulls in
npm packages
Other registry items
Files it writes
More from shadcn-table-library
All 18 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Animated Icons Tableanimated-icons-table | shadcn-table-library | Blocks | Free | 2 deps · 9 files | |
| Comparison Tablecomparison-table | shadcn-table-library | Blocks | Free | 1 dep · 4 files | |
| Data Tabledata-table | shadcn-table-library | Blocks | Free | 1 dep · 4 files | |
| Density & Exportdensity-export-table | shadcn-table-library | Blocks | Free | 1 dep · 4 files | |
| Editable Tableeditable-table | shadcn-table-library | Blocks | Free | 1 dep · 3 files | |
| Grouped Tablegrouped-table | shadcn-table-library | Blocks | Free | 1 dep · 3 files | |
| Heatmap Tableheatmap-table | shadcn-table-library | Blocks | Free | 1 dep · 4 files | |
| Summary / KPI Tablekpi-table | shadcn-table-library | Blocks | Free | 1 dep · 5 files |
