Guide shelves tabs — Blog block

Free

blog-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-tabs

Usage

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.

PropTypeDescription
eyebrowstringWordsa short line above the title ("The workshop’s guides")
title*stringWordsthe hub’s title ("Learn to choose well and care well")
introstringWordsone sentence on what the guides are and how they are sorted
topicsTopic[]the topics offered as filters
shelves*Shelve[]the shelves of guides, one per topic
openstringActionthe page action that opens one guide; it receives the guide
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Topic topics[] · 2 props
PropTypeDescription
id*stringDesignwhat a shelf’s `topic` points to
label*stringWordsthe topic as a visitor reads it ("Care", "Choosing well")
Shelve shelves[] · 4 props
PropTypeDescription
topic*stringDesignthe id of the topic this shelf answers
title*stringWordsthe shelf’s heading ("Caring for your textiles")
seeAllActionstringActionthe 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
PropTypeDescription
id*string | numberDatathe record’s id in the tool that answers it
title*stringWordsthe article’s title
excerptstringWordsa sentence or two from the article
imagestringPicturea picture: a root-relative path (/media/…) or an absolute URL
altstringWordswhat the cover picture shows
sectionstringWordsthe section it belongs to, e.g. "Guides"
authorAuthorwho wrote it
datestringWordswhen it was published, as the site writes it
readingTimestringWordshow long it takes to read, e.g. "6 min"
Author shelves[].items[].author · 6 props
PropTypeDescription
idstring | numberDatathe record’s id in the tool that answers it
name*stringWordsthe person’s name
rolestringWordstheir role or job title
companystringWordswhere they work
avatarstringPicturea picture: a root-relative path (/media/…) or an absolute URL
urlstringDesigna page about them
Options options · 1 props
PropTypeDescription
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
  • 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 articles from 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.

All 35 blog blocks