Record rows list — Table block

Pro

table-record-rows-list · for app, settings pages

Record rows list

Comparable records, each with a picture or initials, two lines and a badge: members, channels

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-record-rows-list

Usage

Its demo data, shortened (Using blocks).

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

const props = {
title: "Members",
subtitle: "The people who have access to this workspace.",
rows: [
{
id: 1,
title: "Camille Roux",
meta: "[email protected]",
badge: "Owner",
tone: "info",
trailing: "Active",
status: "active",
default: true
},
{
id: 2,
title: "Nadia Benali",
meta: "[email protected]",
badge: "Admin",
tone: "neutral",
trailing: "Active",
status: "active"
}
],
primary: {
label: "Invite",
action: "invite"
},
open: "member"
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe list’s heading ("Members")
subtitlestringWordsone line under the title
countnumberDatathe total of records, when the rows are only a page of them
rows*Record<string, unknown>[]Datathe records; each carries the keys the columns name
columnsColumn[]the columns shown, in order
primaryPrimarythe header action ("Invite")
openstringActionthe page a row’s title leads to
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, for screen readers
role*'title' | 'meta' | 'badge' | 'date' | 'person' | 'trailing' | 'avatar'where the column’s value goes in the row
Primary primary · 2 props
PropTypeDescription
label*stringWordsthe words on the button or link
action*stringActiona named action of the page
Options options · 6 props
PropTypeDescription
tabFieldstringDesignthe row key the tabs filter on, "status" by default
pageSizenumberhow many rows a page shows
overdueLabelstringWordswritten beside an overdue date ("late")
emptystringWordswhat an empty list says
footnotestringWordsa line stating the rule, as configured
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
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: primary, open
  • Reads rows from your app

A table section, for app, settings 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

  • 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.
  • 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.
  • 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.
  • Resource totals: records whose amounts matter together: a footer with the selection count and the list’s own totals.

All 24 table blocks