Resource list — Table block
Protable-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-listUsage
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.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe list’s heading ("Orders") |
| subtitle | string | Wordsone line under the title |
| count | number | Datathe 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 |
| statuses | Statuse[] | the words and tone of each status value, as the app defines them |
| filters | Filter[] | filter chips; each is a link the host answers (the query lives in the address) |
| views | View[] | saved views, a segmented switch of links |
| search | Search | the search field |
| sort | Sort | the sort in effect and the page action |
| page | Page | the page shown and the page action |
| perPage | number | Datathe rows per page now, when it differs from page.size |
| perPageOptions | number[] | the page sizes a visitor can pick (10, 25, 50), shown beside the pagination |
| perPageAction | string | Actionthe page action; the record carries perPage (a GET form sends ?perPage= without JavaScript) |
| bulkActions | BulkAction[] | what the selection can do; without any, rows are not selectable |
| rowActions | RowAction[] | what one row can do, in a menu at its end |
| create | Create | the header’s primary action |
| open | string | Actionthe page a row’s first cell leads to |
| empty | Empty | what an empty list says |
| noMatch | NoMatch | what a search or filter that matches nothing says |
| display | Display | the "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 |
| loading | boolean | the rows are being fetched: placeholder rows in the layout’s shape, the toolbar still usable |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Column columns[] · 6 props
| Prop | Type | Description |
|---|---|---|
| key* | string | Designthe row key to read |
| label* | string | Wordsthe 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 |
| sortable | boolean | true: the column’s heading sorts the list |
| priority | number | 1: always visible, 2: from 640 px, 3: from 1024 px; below, it folds under the first cell |
| hidden | boolean | true: 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
| Prop | Type | Description |
|---|---|---|
| value* | string | Designthe value a row stores |
| label* | string | Wordsthe status in words, e.g. "Paid" |
| tone | 'neutral' | 'info' | 'success' | 'warning' | 'danger' | the status colour |
Filter filters[] · 5 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe link’s words, e.g. "Unpaid" |
| count | number | Datahow many records it holds, as the host counted them |
| active | boolean | true: this is the one shown now |
| action* | string | Actionthe page action that shows it |
| record | Record<string, unknown> | Datawhat the action needs (the filter’s value) |
View views[] · 4 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe link’s words, e.g. "Unpaid" |
| active | boolean | true: this is the one shown now |
| action* | string | Actionthe page action that shows it |
| record | Record<string, unknown> | Datawhat the action needs (the filter’s value) |
Search search · 3 props
| Prop | Type | Description |
|---|---|---|
| placeholder* | string | Wordswhat the search field says ("Search for an order") |
| value | string | Wordsthe current query, as the address carries it |
| action* | string | Actionthe page the form sends the query to (?q=) |
Sort sort · 3 props
| Prop | Type | Description |
|---|---|---|
| key | string | Designthe column sorted now |
| dir | 'asc' | 'desc' | the sort direction: ascending or descending |
| action* | string | Actionthe page action; the record carries sort and dir |
Page page · 3 props
| Prop | Type | Description |
|---|---|---|
| number* | number | the page shown, from 1 |
| size* | number | how many rows a page holds |
| action* | string | Actionthe page action; the record carries page |
BulkAction bulkActions[] · 4 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe action’s words, e.g. "Archive" |
| action* | string | Actionthe page action: through a host that runs actions it receives `{ ids }`; else a link whose record carries ids (comma separated) |
| destructive | boolean | true: it deletes or cannot be undone, and looks it |
| confirm | string | Wordsthe question asked before it runs, saying it cannot be undone |
RowAction rowActions[] · 4 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Words"Duplicate", "Archive" |
| action* | string | Actionthe page action: through a host that runs actions it receives `{ id, ids: [id] }`; else a link whose record carries id |
| destructive | boolean | true: it deletes or cannot be undone, and looks it |
| confirm | string | Wordsthe question asked before it runs, saying it cannot be undone |
Create create · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe words on the button or link |
| action* | string | Actiona named action of the page |
Empty empty · 3 props
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordswhat an empty collection says ("No orders yet") |
| text | string | Wordsthe empty state’s text |
| action | Action | the empty state’s call to action: its words and the page action |
Action empty.action · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe words on the button or link |
| action* | string | Actiona named action of the page |
NoMatch noMatch · 3 props
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordswhat a search or filter that matches nothing says |
| text | string | Wordsthe no-match state’s text |
| clear | Clear | the clear action: its words and the page action it runs |
Clear noMatch.clear · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe words on the button or link |
| action* | string | Actiona named action of the page |
Display display · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe menu button’s words ("Display") |
| action* | string | Actionwhere 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
| Prop | Type | Description |
|---|---|---|
| currency | string | DesignISO 4217 for money cells, EUR by default |
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a 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).
| Member | What it is for |
|---|---|
| href | the address an action leads to, or null to hide what leads there |
| act | runs a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error } |
| go | navigates after a success |
| can | whether the page has this action |
| money | formats a price, given in cents |
| asset | a picture’s address as your app serves it |
| Link | your router’s link component |
| navigate | your router’s navigation, for links the block follows itself |
| cartCount | the cart badge’s number |
| cartDrawer | whether your app has a cart drawer |
| cartOpen | whether the cart drawer is open |
| label | your 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:
| Key | English | French |
|---|---|---|
| newsletter.already | You are already subscribed. | Vous êtes déjà inscrit. |
| newsletter.done | Done: you are subscribed. | C’est noté : vous êtes inscrit. |
| newsletter.invalid | Check the email address. | Vérifiez l’adresse e-mail. |
| newsletter.tooMany | Too many attempts, try again in a moment. | Trop de tentatives, réessayez dans un moment. |
| rl.alwaysShown | always shown | toujours affichée |
| rl.columns | Columns shown | Colonnes affichées |
| rl.display | Display | Affichage |
| rl.done | “{label}”: {count} done | « {label} » : {count} traité(s) |
| rl.everySelected | All {count} results are selected | Les {count} résultats sont sélectionnés |
| rl.here | On this page only | Sur 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.perPage | Per page | Par page |
| rl.perPageShow | Show | Afficher |
| rl.rowActions | Actions on {name} | Actions sur {name} |
| rl.rowDone | “{label}”: done for {name} | « {label} » : fait pour {name} |
| rl.save | Save | Enregistrer |
| rl.saved | Display saved | Affichage enregistré |
| rl.selectEvery | Select all {count} results | Sé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
rowsfrom 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.