Resource list — Table block

Pro

table-resource-list · for app pages

Resource list

Records a team searches, sorts and acts on, one comfortable row each: orders, invoices, customers

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-resource-list

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import TableResourceList from '@/components/trame/blocks/table/table-resource-list.vue'

const props = {
title: "Orders",
subtitle: "Online shop",
count: 124,
columns: [
{
key: "number",
label: "Order",
type: "id",
sortable: true
},
{
key: "customer",
label: "Customer",
type: "person",
sortable: true,
priority: 2
}
],
rows: [
{
id: 1048,
photo: "https://images.unsplash.com/photo-1694561418303-16393986b86d?w=1600&q=80",
number: "#1048",
customer: {
name: "Camille Laurent"
},
date: "2026-10-09",
status: "pending",
items: 1,
total: 4900
},
{
id: 1047,
photo: "https://images.unsplash.com/photo-1602845860431-35374f24f48d?w=1600&q=80",
number: "#1047",
customer: {
name: "Mehdi Bensaid"
},
date: "2026-10-09",
status: "paid",
items: 2,
total: 8650
}
],
statuses: [
{
value: "pending",
label: "Awaiting payment",
tone: "warning"
},
{
value: "paid",
label: "Paid",
tone: "info"
}
],
filters: [
{
label: "All",
count: 124,
active: true,
action: "orders.filter",
record: {
id: "all"
}
},
{
label: "Awaiting payment",
count: 8,
action: "orders.filter",
record: {
id: "pending"
}
}
],
views: [
{
label: "All orders",
active: true,
action: "orders.view",
record: {
id: "all"
}
},
{
label: "This week",
action: "orders.view",
record: {
id: "week"
}
}
],
search: {
placeholder: "Search for an order or a customer",
action: "orders.list"
},
sort: {
key: "date",
dir: "desc",
action: "orders.list"
},
page: {
number: 1,
size: 10,
action: "orders.list"
},
bulkActions: [
{
label: "Mark as shipped",
action: "orders.ship"
},
{
label: "Export",
action: "orders.export"
}
],
rowActions: [
{
label: "Resend confirmation",
action: "order.resend"
},
{
label: "Cancel order",
action: "order.cancel",
destructive: true,
confirm: "The order will be canceled and the customer notified by email. This can’t be undone."
}
],
create: {
label: "Create an order",
action: "orders.new"
},
open: "order.open",
empty: {
title: "No orders yet",
text: "Orders placed in the shop will show up here.",
action: {
label: "Create an order",
action: "orders.new"
}
},
noMatch: {
title: "No orders match",
text: "Try another number or name, or remove a filter.",
clear: {
label: "Clear search and filters",
action: "orders.list"
}
},
options: {
currency: "USD"
}
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe list’s heading ("Orders")
subtitlestringWordsone line under the title
countnumberDatathe total of records, when the rows are only a page of them
columns*Column[]the columns, the first being the record’s identity
rows*Record<string, unknown>[]Datathe records; each carries an id and the keys the columns name; money in cents; an `image` column holds a picture address; `tones` maps a key to a tone
statusesStatuse[]the words and tone of each status value, as the app defines them
filtersFilter[]filter chips; each is a link the host answers (the query lives in the address)
viewsView[]saved views, a segmented switch of links
searchSearchthe search field
sortSortthe sort in effect and the page action
pagePagethe page shown and the page action
perPagenumberDatathe rows per page now, when it differs from page.size
perPageOptionsnumber[]the page sizes a visitor can pick (10, 25, 50), shown beside the pagination
perPageActionstringActionthe page action; the record carries perPage (a GET form sends ?perPage= without JavaScript)
bulkActionsBulkAction[]what the selection can do; without any, rows are not selectable
rowActionsRowAction[]what one row can do, in a menu at its end
createCreatethe header’s primary action
openstringActionthe page a row’s first cell leads to
emptyEmptywhat an empty list says
noMatchNoMatchwhat a search or filter that matches nothing says
displayDisplaythe "Display" menu that shows or hides columns and saves the choice; without it (or when the page lacks the action) the menu still hides columns on the page once its script runs, nothing saved, and is absent without script
loadingbooleanthe rows are being fetched: placeholder rows in the layout’s shape, the toolbar still usable
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Column columns[] · 6 props
PropTypeDescription
key*stringDesignthe row key to read
label*stringWordsthe column’s name
type'text' | 'id' | 'money' | 'number' | 'date' | 'status' | 'person' | 'image' | 'boolean'how a cell reads; without it, from the first values: number, date (ISO), boolean, status (a value of statuses), person ({ name }), else text; money only when said
sortablebooleantrue: the column’s heading sorts the list
prioritynumber1: always visible, 2: from 640 px, 3: from 1024 px; below, it folds under the first cell
hiddenbooleantrue: the host’s saved choice hides this column (left out of the cells, the card lines and the sort links); the first column is always shown
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
Filter filters[] · 5 props
PropTypeDescription
label*stringWordsthe link’s words, e.g. "Unpaid"
countnumberDatahow many records it holds, as the host counted them
activebooleantrue: this is the one shown now
action*stringActionthe page action that shows it
recordRecord<string, unknown>Datawhat the action needs (the filter’s value)
View views[] · 4 props
PropTypeDescription
label*stringWordsthe link’s words, e.g. "Unpaid"
activebooleantrue: this is the one shown now
action*stringActionthe page action that shows it
recordRecord<string, unknown>Datawhat the action needs (the filter’s value)
Search search · 3 props
PropTypeDescription
placeholder*stringWordswhat the search field says ("Search for an order")
valuestringWordsthe current query, as the address carries it
action*stringActionthe page the form sends the query to (?q=)
Sort sort · 3 props
PropTypeDescription
keystringDesignthe column sorted now
dir'asc' | 'desc'the sort direction: ascending or descending
action*stringActionthe page action; the record carries sort and dir
Page page · 3 props
PropTypeDescription
number*numberthe page shown, from 1
size*numberhow many rows a page holds
action*stringActionthe page action; the record carries page
BulkAction bulkActions[] · 4 props
PropTypeDescription
label*stringWordsthe action’s words, e.g. "Archive"
action*stringActionthe page action: through a host that runs actions it receives `{ ids }`; else a link whose record carries ids (comma separated)
destructivebooleantrue: it deletes or cannot be undone, and looks it
confirmstringWordsthe question asked before it runs, saying it cannot be undone
RowAction rowActions[] · 4 props
PropTypeDescription
label*stringWords"Duplicate", "Archive"
action*stringActionthe page action: through a host that runs actions it receives `{ id, ids: [id] }`; else a link whose record carries id
destructivebooleantrue: it deletes or cannot be undone, and looks it
confirmstringWordsthe question asked before it runs, saying it cannot be undone
Create create · 2 props
PropTypeDescription
label*stringWordsthe words on the button or link
action*stringActiona named action of the page
Empty empty · 3 props
PropTypeDescription
title*stringWordswhat an empty collection says ("No orders yet")
textstringWordsthe empty state’s text
actionActionthe empty state’s call to action: its words and the page action
Action empty.action · 2 props
PropTypeDescription
label*stringWordsthe words on the button or link
action*stringActiona named action of the page
NoMatch noMatch · 3 props
PropTypeDescription
title*stringWordswhat a search or filter that matches nothing says
textstringWordsthe no-match state’s text
clearClearthe clear action: its words and the page action it runs
Clear noMatch.clear · 2 props
PropTypeDescription
label*stringWordsthe words on the button or link
action*stringActiona named action of the page
Display display · 2 props
PropTypeDescription
label*stringWordsthe menu button’s words ("Display")
action*stringActionwhere the visible columns are saved: through a host that runs actions it receives `{ keys }`, the visible column keys in order; without script a form posts them as repeated `keys` fields
Options options · 2 props
PropTypeDescription
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 }
gonavigates after a success
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
navigateyour router’s navigation, for links the block follows itself
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.
rl.alwaysShownalways showntoujours affichée
rl.columnsColumns shownColonnes affichées
rl.displayDisplayAffichage
rl.done“{label}”: {count} done« {label} » : {count} traité(s)
rl.everySelectedAll {count} results are selectedLes {count} résultats sont sélectionnés
rl.hereOn this page onlySur cette page seulement
rl.hiddenCount{count} hidden{count} masquée(s)
rl.partly“{label}”: {done} done, {failed} failed and still selected« {label} » : {done} traité(s), {failed} en échec, restés sélectionnés
rl.perPagePer pagePar page
rl.perPageShowShowAfficher
rl.rowActionsActions on {name}Actions sur {name}
rl.rowDone“{label}”: done for {name}« {label} » : fait pour {name}
rl.saveSaveEnregistrer
rl.savedDisplay savedAffichage enregistré
rl.selectEverySelect all {count} resultsSélectionner les {count} résultats

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: filters[], views[], search, sort, page, perPageAction, bulkActions[], rowActions[], create, open, empty.action, noMatch.clear, view.columns
  • Reads rows from your app

A table section, for app pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, reka-ui, tailwind-merge.

Built with

The components this block is made of; each one installs on its own too.

More table blocks

  • Nested rows cards with lines: each parent as a card (identity, status and figures on its head) with its lines listed under it, all open: fewer parents read one by one, lines with their pictures.
  • 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.
  • Record rows list: comparable records, each with a picture or initials, two lines and a badge: members, channels.
  • Resource totals: records whose amounts matter together: a footer with the selection count and the list’s own totals.
  • Spreadsheet grid: Edit a dense table with a frozen first column and row selection, then save the edits in one go.
  • Spreadsheet summary bar: Keep the selection count and numeric sum prominent above the editable grid, saved in one go.
  • Stage rows track cards: fewer records each needing a next step: one card per record with a status sentence, the labelled track full width and the action beside it, filters in a rail.
  • Stage rows track: many records followed at a glance (shipments, sales orders): a table whose progress column is a row of joined dots, an exception named in words.

All 24 table blocks