Record pager bar — Page heading block
Propage-heading-record-pager-bar · for catalog, app, account, landing pages
Record pager bar
Records read one after the other (a ticket, an order in a queue): a back link and "8 of 42" with previous and next above the title, its state beside it
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/page-heading-record-pager-barUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import PageHeadingRecordPagerBar from '@/components/trame/blocks/page-heading/page-heading-record-pager-bar.vue'
const props = {
title: "Refund request #58213",
breadcrumb: [
{
label: "Back to requests",
action: "requests"
},
{
label: "Request #58213"
}
],
status: "Open",
meta: [
"From Dana Lever",
"By email"
],
actions: [
{
label: "Assign to me",
action: "request.assign",
emphasis: "secondary"
},
{
label: "Resolve",
action: "request.resolve"
}
],
pager: {
position: 8,
total: 42,
previous: {
label: "Previous request",
action: "request",
record: {
id: 57
}
},
next: {
label: "Next request",
action: "request",
record: {
id: 59
}
}
}
}
</script>
<template>
<PageHeadingRecordPagerBar v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe page’s title |
| lead | string | Wordsone or two sentences under the title |
| breadcrumb | Breadcrumb[] | the path to this page, each step a link |
| meta | string[] | Wordsa fact about the page: a date, a count, an owner |
| actions | Action[] | the buttons beside the heading |
| status | string | Wordsthe record’s state as the app words it ("Open", "Draft") |
| pager* | Pager | the previous and next links through the list |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Breadcrumb breadcrumb[] · 4 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe link’s words, e.g. "See the collection" |
| action | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action applies to, passed to the host with it, if any |
| url | string | Designan address outside the app |
Action actions[] · 5 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe link’s words, e.g. "See the collection" |
| action | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action applies to, passed to the host with it, if any |
| url | string | Designan address outside the app |
| emphasis | 'primary' | 'secondary' | the first action is primary unless said otherwise |
Pager pager · 4 props
| Prop | Type | Description |
|---|---|---|
| position* | number | Datathe record’s place in the list being walked |
| total* | number | Datahow many records the list holds |
| previous | Previous | the previous link: its words and where it leads |
| next | Next | the next link: its words and where it leads |
Previous pager.previous · 4 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe link’s words, e.g. "See the collection" |
| action | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action applies to, passed to the host with it, if any |
| url | string | Designan address outside the app |
Next pager.next · 4 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe link’s words, e.g. "See the collection" |
| action | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action applies to, passed to the host with it, if any |
| url | string | Designan address outside the app |
Options options · 2 props
| Prop | Type | Description |
|---|---|---|
| heading | 'h1' | 'h2' | h2 by default: a block’s title; h1 when the heading opens the page |
| 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 |
| 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:
breadcrumb[],actions[],pager.previous,pager.next
A page heading section, for catalog, app, account, landing pages; it uses @lucide/vue, class-variance-authority, clsx, reka-ui, tailwind-merge.
More page heading blocks
- Centered: collections and help pages: title and lead centred, one call to action.
- Profile avatar centered: a person’s or a community’s page where the identity leads (a member, a creator, a club): the picture large and centred, everything under it centred, the tabs under a hairline.
- Profile avatar left: a person, a company or a space: a large picture or monogram beside the title, state and facts, with the views as tabs under it.
- Search card: finder pages: a centred title above a card holding a search field and up to two selects.
- Stats tiles: overviews: the title, then three or four compact tiles with a value, a label and a change.
- Steps stepper: multi-step setups: the title, a lead and a stepper showing done, current and to do.
- Tabs underline tabs: lists with views: the title, then underline tabs with their counts, a search beside the title if there is one.
- With actions: records and documents: the title and its facts at the left, one or two buttons at the right.