Facets tabbed — Record block
Prorecord-facets-tabbed · for app pages
Facets tabbed
A record with many facets (overview, items, documents, history): one panel at a time, the tab kept in the address
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/record-facets-tabbedUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import RecordFacetsTabbed from '@/components/trame/blocks/record/record-facets-tabbed.vue'
const props = {
title: "Order #1048",
recordId: "1048",
subtitle: "Placed on October 9, 2026 in the online shop",
back: {
label: "Orders",
action: "orders.list"
},
status: {
label: "Paid",
tone: "info",
transitions: [
{
label: "Mark as shipped",
action: "order.ship"
},
{
label: "Cancel order",
action: "order.cancel",
tone: "danger"
}
]
},
actions: {
primary: {
label: "Create label",
action: "order.label"
},
secondary: [
{
label: "Edit",
action: "order.edit"
},
{
label: "Print invoice",
action: "order.invoice"
}
],
destructive: {
label: "Delete",
action: "order.delete",
confirm: {
title: "Delete order #1048?",
text: "The order and its history will be erased. This can’t be undone.",
confirmLabel: "Delete permanently"
}
}
},
tabs: [
{
id: "overview",
label: "Overview",
active: true,
action: "order.tab"
},
{
id: "items",
label: "Items",
count: 3,
action: "order.tab"
}
],
sections: [
{
title: "Summary",
fields: [
{
label: "Number",
type: "id",
value: "#1048"
},
{
label: "Date",
type: "date",
value: "2026-10-09"
}
]
},
{
title: "Customer",
rail: true,
fields: [
{
label: "Name",
value: "Camille Laurent",
action: "customer.open",
record: {
id: 214
}
},
{
label: "Email",
type: "email",
value: "[email protected]"
}
]
}
],
related: [
{
title: "Items",
columns: [
{
key: "name",
label: "Item"
},
{
key: "qty",
label: "Qty",
type: "number"
}
],
rows: [
{
id: 1,
name: "Windbreaker · Midnight blue · M",
qty: 1,
unit: 12900,
total: 12900
},
{
id: 2,
name: "Insulated bottle 25 oz",
qty: 2,
unit: 2400,
total: 4800
}
],
empty: "No items on this order.",
tab: "items"
}
],
activity: {
title: "History",
tab: "history",
items: [
{
label: "Payment received",
detail: "Credit card, $209.00",
date: "October 9, 2026, 2:32 PM"
},
{
label: "Order placed",
by: "Camille Laurent",
date: "October 9, 2026, 2:30 PM"
}
]
},
statuses: [
{
value: "pending",
label: "Awaiting payment",
tone: "warning"
},
{
value: "paid",
label: "Paid",
tone: "info"
}
],
options: {
currency: "USD"
}
}
</script>
<template>
<RecordFacetsTabbed v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe record’s name ("Order #1048", "Camille Laurent") |
| subtitle | string | Wordsone line under the title: its kind, its date |
| recordId | string | number | Datathe record’s id: the page’s actions run through the host with it (`{ id, ids: [id] }`) |
| back | Back | the back action: its words and the page action it runs |
| status | Status | the record’s status, in words and colour |
| actions | Actions | what can be done on the record |
| tabs* | Tab[] | tabs variant: the address holds the tab; each is a link |
| sections* | Section[] | the fields, grouped; each rendered as a definition list |
| related | Related[] | related records, as small tables, e.g. "Invoices" |
| activity | Activity | the record’s history |
| statuses | Statuse[] | words and tones of the values of `status` fields and columns |
| loading | boolean | the record is being fetched: each value is a placeholder under its label, the page busy |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Back back · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Words"Orders" |
| action* | string | Actionthe list |
Status status · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe status in words, as the app says it |
| tone | 'neutral' | 'info' | 'success' | 'warning' | 'danger' | the status colour |
| transitions | Transition[] | the moves the server allows from this status, and no others |
Transition status.transitions[] · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Words"Mark as shipped" |
| action* | string | Actionthe page action that moves the record there |
| tone | 'neutral' | 'info' | 'success' | 'warning' | 'danger' | the status colour |
Actions actions · 3 props
| Prop | Type | Description |
|---|---|---|
| primary | Primary | the main button: its words and the page action it runs |
| secondary | Secondary[] | other actions on the record |
| destructive | Destructive | the destructive action: its words and the page action it runs |
Primary actions.primary · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe words on the button or link |
| action* | string | Actiona named action of the page |
Secondary actions.secondary[] · 4 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe words on the button or link |
| action* | string | Actiona named action of the page |
| tone | 'neutral' | 'info' | 'success' | 'warning' | 'danger' | the status colour |
| confirm | Confirm | asked before it runs, as the destructive action is |
Confirm actions.secondary[].confirm · 3 props
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe confirmation’s title |
| text* | string | Wordswhat it does and whether it can be undone |
| confirmLabel* | string | Wordsthe words on the confirming button |
Destructive actions.destructive · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Words"Delete" |
| action* | string | Actiona named action of the page |
| confirm* | Confirm | the question asked before it runs |
Confirm actions.destructive.confirm · 3 props
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe confirmation’s title |
| text* | string | Wordswhat it does and whether it can be undone |
| confirmLabel* | string | Wordsthe words on the confirming button |
Tab tabs[] · 5 props
| Prop | Type | Description |
|---|---|---|
| id* | string | Designthe tab’s key |
| label* | string | Wordsthe words on the button or link |
| count | number | Datahow many, as the host counted them |
| active | boolean | true: the one selected now |
| action* | string | Actionthe page action; the record carries id |
Section sections[] · 4 props
| Prop | Type | Description |
|---|---|---|
| title* | string | Words"Delivery", "Contact" |
| tab | string | Designtabs variant: the tab it belongs to (the first tab when empty) |
| rail | boolean | profile variant: kept in the side rail |
| fields* | Field[] | the form’s fields, in order |
Field sections[].fields[] · 8 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe words on the button or link |
| type | 'text' | 'longtext' | 'id' | 'money' | 'number' | 'date' | 'datetime' | 'email' | 'phone' | 'status' | 'boolean' | 'select' | 'relation' | 'image' | 'file' | how a value reads: datetime, a moment in UTC (one without a zone as written); select, the option’s label in its tone; relation, the linked record’s name, a link through `action` and `record`; image, a thumbnail of the address; file, a link to the address with its name and size |
| value | string | number | boolean | unknown | Datathe stored value; money in cents; an empty value shows "—" |
| tone | 'neutral' | 'info' | 'success' | 'warning' | 'danger' | the status colour |
| action | string | Actionopens the linked record |
| record | Record<string, unknown> | Datathe record the action applies to, passed to the host with it, if any |
| options | Option[] | select: the words and tones of the values it may hold |
| file | File | a file held in the field |
Option sections[].fields[].options[] · 3 props
| Prop | Type | Description |
|---|---|---|
| value* | string | Designthe value stored |
| label* | string | Wordsthe value in words, as shown |
| tone | 'neutral' | 'info' | 'success' | 'warning' | 'danger' | the status colour |
File sections[].fields[].file · 2 props
| Prop | Type | Description |
|---|---|---|
| name | string | Wordsthe file’s name, its address’s last part by default |
| size | number | Datain bytes |
Related related[] · 9 props
| Prop | Type | Description |
|---|---|---|
| title* | string | Words"Articles", "Invoices" |
| tab | string | Designtabs variant: the tab it belongs to |
| total | number | Datathe real total, when the rows are only some of them |
| columns* | Column[] | the related list’s columns, in order |
| rows* | Record<string, unknown>[] | Datathe related list’s rows, in order |
| open | string | Actionwhat a row’s first cell leads to |
| all | All | the see-all link: its words and the page action it runs |
| create | Create | the create action: its words and the page action it runs |
| empty | string | Wordswhat an empty list says |
Column related[].columns[] · 3 props
| Prop | Type | Description |
|---|---|---|
| key* | string | Designthe row key to read |
| label* | string | Wordsthe column’s name, as shown |
| type | 'text' | 'longtext' | 'id' | 'money' | 'number' | 'date' | 'datetime' | 'email' | 'phone' | 'status' | 'boolean' | 'select' | 'relation' | 'image' | 'file' | how a value reads: datetime, a moment in UTC (one without a zone as written); select, the option’s label in its tone; relation, the linked record’s name, a link through `action` and `record`; image, a thumbnail of the address; file, a link to the address with its name and size |
All related[].all · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Words"See all orders" |
| action* | string | Actiona named action of the page |
Create related[].create · 2 props
| Prop | Type | Description |
|---|---|---|
| label | string | Words"Add a service visit" ("Add" by default) |
| action* | string | Actionopens the form of a record linked to this one; the record carries id |
Activity activity · 4 props
| Prop | Type | Description |
|---|---|---|
| title* | string | Words"History" |
| tab | string | Designtabs variant: the tab it belongs to |
| items* | Item[] | the history’s entries |
| empty | string | Wordswhat an empty history says |
Item activity.items[] · 4 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat happened |
| date* | string | Wordsas the app writes it |
| by | string | Wordswho did it |
| detail | string | Wordsa line of detail |
Statuse statuses[] · 3 props
| Prop | Type | Description |
|---|---|---|
| value* | string | Designthe value a status field stores |
| label* | string | Wordsthe value in words, as shown |
| tone | 'neutral' | 'info' | 'success' | 'warning' | 'danger' | the status colour |
Options options · 2 props
| Prop | Type | Description |
|---|---|---|
| currency | string | DesignISO 4217, 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 |
| 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:
back,status.transitions[],actions.primary,actions.secondary[],actions.destructive,tabs[],sections[].fields[],related[].open,related[].all,related[].create - Reads
record,relatedfrom your app
A record 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 record blocks
- Customer case view stacked: A customer-facing case page showing only the merchant’s own public replies and a reply form, without internal notes or macros.
- Detail page: a record read top to bottom: header with its status and actions, fields in sections, linked lists beneath.
- Detail split: a record read mostly for its linked lists: its fields in a narrow column beside them.
- Invoice compact: A narrow receipt-like document with stacked line items for the merchant’s own short invoices.
- Invoice document: A complete document with seller, buyer and a tax ledger, using the merchant’s own invoice only.
- Invoice split: The merchant’s own invoice with a separate payment summary and actions for collection workflows.
- Profile sidebar: a person or an organisation: a side rail with identity, stored counters and key facts, the work in the main column.
- Shipment detail map band: the map as a wide band under the header with the route and facts in a card over it, the feed in full width below: a team that reads where the shipment is first; positions and times from the carrier only.