Guide shelves tabs — Blog block
Freeblog-guide-shelves-tabs · for home, catalog, landing pages
Guide shelves tabs
One shelf at a time, the topic tabs swap its guides, the first one large: four to twelve guides in a small space.
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/blog-guide-shelves-tabsUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import BlogGuideShelvesTabs from '@/components/trame/blocks/blog/blog-guide-shelves-tabs.vue'
const props = {
eyebrow: "The workshop guides",
title: "Choose well, care well, host well",
intro: "Our workshop advice, sorted by subject: read it before you buy, or on the day a piece needs a little care.",
topics: [
{
id: "care",
label: "Care"
},
{
id: "choose",
label: "Choosing well"
}
],
shelves: [
{
topic: "care",
title: "Caring for your textiles and your wood",
seeAllAction: "topic",
items: [
{
id: "g-lin",
title: "Washing linen without damaging it",
excerpt: "Temperature, spin, drying: the habits that soften linen wash after wash.",
image: "https://images.unsplash.com/photo-1528458909336-e7a0adfed0a5?w=900&q=80",
alt: "Close-up of natural beige linen",
section: "Linens",
readingTime: "4 min read"
},
{
id: "g-lai",
title: "Storing wool for the summer",
excerpt: "Air it, fold it, and keep moths away without harsh products.",
image: "https://images.unsplash.com/photo-1670764732222-e787bccd934f?w=900&q=80",
alt: "A skein of undyed wool",
section: "Wool",
readingTime: "3 min read"
}
]
},
{
topic: "choose",
title: "Choosing the right material",
seeAllAction: "topic",
items: [
{
id: "g-cot",
title: "Linen or cotton: which is right for your bedding?",
excerpt: "Feel, warmth, lifespan: what each fiber brings to the bedroom.",
image: "https://images.unsplash.com/photo-1616431101491-554c0932ea40?w=900&q=80",
alt: "A cotton branch with its bolls open",
section: "Bedding",
readingTime: "6 min read"
},
{
id: "g-cer",
title: "Reading a ceramic’s finish",
excerpt: "Glossy, matte or raw glaze: where it shows, where it wears, what it forgives.",
image: "https://images.unsplash.com/photo-1589051088132-06f36a22012a?w=900&q=80",
alt: "Hands covered in gray clay raising the rim of a bowl",
section: "Ceramics",
readingTime: "5 min read"
}
]
}
],
open: "article"
}
</script>
<template>
<BlogGuideShelvesTabs v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| eyebrow | string | Wordsa short line above the title ("The workshop’s guides") |
| title* | string | Wordsthe hub’s title ("Learn to choose well and care well") |
| intro | string | Wordsone sentence on what the guides are and how they are sorted |
| topics | Topic[] | the topics offered as filters |
| shelves* | Shelve[] | the shelves of guides, one per topic |
| open | string | Actionthe page action that opens one guide; it receives the guide |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Topic topics[] · 2 props
| Prop | Type | Description |
|---|---|---|
| id* | string | Designwhat a shelf’s `topic` points to |
| label* | string | Wordsthe topic as a visitor reads it ("Care", "Choosing well") |
Shelve shelves[] · 4 props
| Prop | Type | Description |
|---|---|---|
| topic* | string | Designthe id of the topic this shelf answers |
| title* | string | Wordsthe shelf’s heading ("Caring for your textiles") |
| seeAllAction | string | Actionthe page action of the shelf’s "See all" link; it receives the topic |
| items* | Item[] | Datathe merchant’s own guides for this shelf, in the order they should be read |
Item shelves[].items[] · 9 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | Datathe record’s id in the tool that answers it |
| title* | string | Wordsthe article’s title |
| excerpt | string | Wordsa sentence or two from the article |
| image | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| alt | string | Wordswhat the cover picture shows |
| section | string | Wordsthe section it belongs to, e.g. "Guides" |
| author | Author | who wrote it |
| date | string | Wordswhen it was published, as the site writes it |
| readingTime | string | Wordshow long it takes to read, e.g. "6 min" |
Author shelves[].items[].author · 6 props
| Prop | Type | Description |
|---|---|---|
| id | string | number | Datathe record’s id in the tool that answers it |
| name* | string | Wordsthe person’s name |
| role | string | Wordstheir role or job title |
| company | string | Wordswhere they work |
| avatar | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| url | string | Designa page about them |
Options options · 1 props
| Prop | Type | Description |
|---|---|---|
| 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
- Subtle motion: one short reveal; still under reduced motion
- Real buttons and links, a visible focus
- Asks your app through actions:
shelves[].seeAllAction,open - Reads
articlesfrom your app
A blog section, for home, catalog, landing pages; it uses @lucide/vue, clsx, motion, tailwind-merge.
More blog blocks
- Front page feature stack: a travel, culture or lifestyle magazine home: the lead and up to four stories as alternating picture-and-text bands, each with a kicker and a deck.
- Front page issue cover: a periodic journal: the issue’s name very large, the lead story and a numbered table of contents, no picture required.
- Front page lead trio: a lead story over its cover, then three stories of equal weight below it.
- Front page mosaic: a collage of up to four stories with covers (one tall, two square, one wide): a journal whose pictures carry it.
- Journal masthead: a journal that sells itself as a title: the name very large and centred between hairlines, the lead beside its cover, other stories in ruled text columns.
- Latest lines: one line per article, date and title, no excerpt: a teaser at the foot of a page or of a product.
- Lead and rail: the usual blog home: one large lead story and two or three short stories stacked beside it.
- More to read side column: the writer and the newsletter in the main column, a side column of related links and the most read the journal itself ranks: a news-like article.