Action rows actionable — Table block
Protable-action-rows-actionable · for app, settings pages
Action rows actionable
Records that take one inline action and a state (join, mark done, revoke); done rows dim
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-action-rows-actionableUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import TableActionRowsActionable from '@/components/trame/blocks/table/table-action-rows-actionable.vue'
const props = {
title: "Channels",
subtitle: "Join the ones for your depot and your shift.",
rows: [
{
id: "c1",
title: "#fleet-updates",
meta: "86 members",
badge: "Public",
tone: "neutral"
},
{
id: "c2",
title: "#dispatch-north",
meta: "14 members",
badge: "Joined",
tone: "success",
done: true
}
],
rowAction: {
label: "Join",
doneLabel: "Leave",
action: "join"
}
}
</script>
<template>
<TableActionRowsActionable 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 ("Members") |
| subtitle | string | Wordsone line under the title |
| count | number | Datathe 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 |
| columns | Column[] | the columns shown, in order |
| rowAction* | RowAction | the action each row offers, e.g. "Mark done" |
| primary | Primary | the header action ("Invite") |
| open | string | Actionthe page a row’s title leads to |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Column columns[] · 3 props
| Prop | Type | Description |
|---|---|---|
| key* | string | Designthe row key to read |
| label* | string | Wordsthe column’s name, for screen readers |
| role* | 'title' | 'meta' | 'badge' | 'date' | 'person' | 'trailing' | 'avatar' | where the column’s value goes in the row |
RowAction rowAction · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat the row’s action says ("Join", "Mark done") |
| doneLabel | string | Wordswhat it says once the row is done ("Reopen") |
| action* | string | Actiona named action of the page |
Primary primary · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe words on the button or link |
| action* | string | Actiona named action of the page |
Options options · 6 props
| Prop | Type | Description |
|---|---|---|
| tabField | string | Designthe row key the tabs filter on, "status" by default |
| pageSize | number | how many rows a page shows |
| overdueLabel | string | Wordswritten beside an overdue date ("late") |
| empty | string | Wordswhat an empty list says |
| footnote | string | Wordsa line stating the rule, as configured |
| 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 } |
| can | whether the page has this action |
| asset | a picture’s address as your app serves it |
| Link | your router’s link component |
| 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. |
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:
rowAction,primary,open - Reads
rowsfrom 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
- Audit log timeline: A dated ledger with inline field changes for reconstructing the merchant’s own sequence of events.
- Audit log: An exhaustive filterable register for reviewing the merchant’s own recorded actions and changes.
- 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.
- 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.