Nested rows inline expand — Table block

Pro

table-nested-rows-inline-expand · for app, account pages

Nested rows inline expand

A table of parent records whose row opens its lines as an indented sub-table underneath, the first one open: orders and their lines, customers and their invoices, scanned by column

Documentation

Installation

One command copies the block into your project with the shadcn CLI (the registry is set once: Installation).

pnpm dlx shadcn-vue@latest add @trame/table-nested-rows-inline-expand

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import TableNestedRowsInlineExpand from '@/components/trame/blocks/table/table-nested-rows-inline-expand.vue'

const props = {
title: "Recent orders",
subtitle: "Orders from the last fifteen days, with their items",
columns: [
{
key: "number",
label: "Order"
},
{
key: "customer",
label: "Customer"
}
],
childColumns: [
{
key: "image",
label: "Photo",
type: "image"
},
{
key: "name",
label: "Item"
}
],
rows: [
{
id: 1,
number: "No. 10481",
customer: "Camille Roussel",
date: "2026-10-12",
status: "paid",
total: 14700,
children: [
{
image: "https://images.unsplash.com/photo-1602845860431-35374f24f48d?w=200&q=80",
name: "Canvas backpack",
variant: "Mustard · 22 L",
quantity: 1,
amount: 8900
},
{
image: "https://images.unsplash.com/photo-1667587029116-3ccb580c7858?w=200&q=80",
name: "Knit beanie",
variant: "Heather gray",
quantity: 2,
amount: 5800
}
]
},
{
id: 2,
number: "No. 10482",
customer: "Hugo Lambert",
date: "2026-10-12",
status: "preparing",
total: 15900,
children: [
{
image: "https://images.unsplash.com/photo-1498082352534-00214cbeb658?w=200&q=80",
name: "Leather hiking boots",
variant: "Size 9",
quantity: 1,
amount: 15900
}
]
}
],
statuses: [
{
value: "paid",
label: "Paid",
tone: "info"
},
{
value: "preparing",
label: "Preparing",
tone: "warning"
}
],
open: "order",
empty: "No items in this order",
options: {
currency: "USD"
}
}
</script>

<template>
<TableNestedRowsInlineExpand v-bind="props" />
</template>

Props

Each prop says who changes it: Words, Picture, Action, Design, Data.* required.

PropTypeDescription
title*stringWordsthe list’s heading ("Orders this month")
subtitlestringWordsone line under it
columns*Column[]the parent’s columns, the first being its identity ("Order no.")
childColumns*ChildColumn[]the columns of a parent’s lines, the first text one naming the line
rows*Row[]Datathe parent records, each with its own lines, as the app holds them (a page of them: the host paginates)
statusesStatuse[]the words and tone of each status value, as the app defines them
openstringActionthe page of a parent record (its first cell leads there)
emptystringWordswhat a parent without lines says ("No items in this order")
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Column columns[] · 3 props
PropTypeDescription
key*stringDesignthe row key to read
label*stringWordsthe column’s name
type'text' | 'money' | 'number' | 'date' | 'status' | 'image'money in cents; image: a picture address beside the line’s name
ChildColumn childColumns[] · 3 props
PropTypeDescription
key*stringDesignthe row key to read
label*stringWordsthe column’s name
type'text' | 'money' | 'number' | 'date' | 'status' | 'image'money in cents; image: a picture address beside the line’s name
Row rows[] · 2 props
PropTypeDescription
id*string | numberDatathe parent’s id in the app
children*Record<string, unknown>[]Dataits lines, each with the keys the child columns name
Statuse statuses[] · 3 props
PropTypeDescription
value*stringDesignthe value a row stores
label*stringWordsthe status in words, e.g. "Paid"
tone'neutral' | 'info' | 'success' | 'warning' | 'danger'the status colour
Options options · 3 props
PropTypeDescription
expanded'none' | 'first' | 'all'which parents start open; the variant’s own default otherwise
currencystringDesignISO 4217 for money cells, EUR by default
mood'inverse' | 'brand' | 'warm' | 'tint' | stringa band of the page that redefines the theme surfaces inside it
What it asks your app for

The block never knows your app: it asks it, through one context provided once, where its links lead, what its actions do, how a price reads and which words to say (The host context).

MemberWhat it is for
hrefthe address an action leads to, or null to hide what leads there
actruns a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error }
canwhether the page has this action
moneyformats a price, given in cents
asseta picture’s address as your app serves it
Linkyour router’s link component
cartCountthe cart badge’s number
cartDrawerwhether your app has a cart drawer
cartOpenwhether the cart drawer is open
labelyour word for an interface key, or undefined to keep the block’s own

The words it says itself, in English and French; label(key) replaces any of them:

KeyEnglishFrench
newsletter.alreadyYou are already subscribed.Vous êtes déjà inscrit.
newsletter.doneDone: you are subscribed.C’est noté : vous êtes inscrit.
newsletter.invalidCheck the email address.Vérifiez l’adresse e-mail.
newsletter.tooManyToo many attempts, try again in a moment.Trop de tentatives, réessayez dans un moment.

Features

  • Every word in the server HTML
  • Same markup in Vue and React
  • Theme tokens only: every theme, light and dark
  • Shows what you give it, invents nothing
  • No motion; still under reduced motion
  • Real buttons and links, a visible focus
  • Asks your app through actions: open
  • Reads rows from your app

A table section, for app, account pages; it uses @lucide/vue, @vueuse/core.

More table blocks

  • Change review split: An event index beside one expanded before-and-after comparison of the merchant’s own recorded values.
  • Column comparison: the same measures in two contexts side by side: an upper header row groups the columns, numbers align right.
  • Filtered rows tabbed: records to sort through: filter chips with counts, an overdue date said in words as well as colour.
  • Grouped sheet grid: Separate editable rows by an existing field value to work through related records, then save the edits in one go.
  • Record rows list: comparable records, each with a picture or initials, two lines and a badge: members, channels.
  • Resource list cards: records read by their picture or a few fields (products, team members): a grid of cards with the same search, filters, sort and selection.
  • Resource list compact: long lists worked through quickly: dense rows, a density switch, a sticky header and identity column.
  • Resource list: records a team searches, sorts and acts on, one comfortable row each: orders, invoices, customers.

All 24 table blocks