Slider thumbs — Hero block
Freehero-slider-thumbs · for home pages
Slider thumbs
A framed slide with a tab of thumbnails notched into its foot, one per slide: a shop or a studio with 3 to 5 strong scenes whose visitor should see what else there is before choosing
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/hero-slider-thumbsUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import HeroSliderThumbs from '@/components/trame/blocks/hero/hero-slider-thumbs.vue'
const props = {
slides: [
{
image: "https://images.unsplash.com/photo-1515886657613-9f3515b0c78f?w=1600&q=80",
alt: "A yellow tracksuit on a seaside basketball court",
title: "Summer starts here",
text: "Light pieces, designed to last more than one season.",
action: {
label: "See the collection",
action: "collection",
record: {
id: "ete"
}
}
},
{
image: "https://images.unsplash.com/photo-1512436991641-6745cdb1723f?w=1600&q=80",
alt: "A rack of shirts and jackets in soft colors",
title: "Organic cotton basics",
text: "Cut and sewn in small batches, restocked all year.",
action: {
label: "Discover the basics",
action: "collection",
record: {
id: "basiques"
}
},
align: "end"
}
]
}
</script>
<template>
<HeroSliderThumbs v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| slides* | Slide[] | 2 to 5 slides, the first screen’s strongest pictures; a sixth is never shown |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Slide slides[] · 6 props
| Prop | Type | Description |
|---|---|---|
| image* | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| alt | string | Wordswhat the picture shows, when the words do not say it (empty: decorative) |
| title* | string | Words3 to 8 words; the first slide’s is the page’s h1 |
| text | string | Wordsone sentence |
| action | Action | the slide’s call to action: its words and the page action |
| align | 'start' | 'center' | 'end' | fullbleed: the picture’s calm side, where the words sit (start by default) |
Action slides[].action · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat happens ("See the collection") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action opens (a category), if any |
Options options · 2 props
| Prop | Type | Description |
|---|---|---|
| height | 'tall' | 'medium' | tall (by default): most of the first screen; medium: about two thirds |
| 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
- Expressive motion, within its budget; still under reduced motion
- Real buttons and links, a visible focus
- Asks your app through actions:
slides[].action
A hero section, for home pages; it uses class-variance-authority, clsx, motion, reka-ui, tailwind-merge.
Built with
The components this block is made of; each one installs on its own too.
More hero blocks
- Signature product rail: a large picture with the promise at its foot and the two or three pieces stacked in a dark column beside it: a shop that wants the promise and the way to buy in the same first screen.
- Signature scene card: a framed scene with the promise at its left and one piece’s card standing on the right, arrows to switch between pieces: a lifestyle shop whose products are shown in a room, not cut out.
- Signature split card: a magazine-like split: a tall picture with one product’s card resting on it: a shop with one hero product or a signature piece.
- Split backdrop: one strong picture fills the whole section behind the words, which stand on one side over a dark scrim: a house for sale, a hotel, a place or a trip that sells itself by its view — the merchant’s own only.
- Split collage: three to five framed pictures, slightly turned and overlapping, beside the words: a lifestyle app, a community, a brand with many faces — the merchant’s own only.
- Split image: a plain picture beside the words, with an optional caption card: a product or a place seen at first glance — the merchant’s own only.
- Split notched: the words above one wide landscape picture whose corners are cut out as notches holding the actions and the caption: an architect, a venue, a hotel whose one strong picture should feel cut into the page — the merchant’s own only.
- Split price card: one plan or one price with what it includes: a single offer sold straight away — the merchant’s own only.