Float orbit — Hero block
Prohero-float-orbit · for home pages
Float orbit
The title above, the pictures in a gentle arc under it, the middle one largest: 2 to 4 products, a calmer opening
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-float-orbitUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import HeroFloatOrbit from '@/components/trame/blocks/hero/hero-float-orbit.vue'
const props = {
title: "Things to keep",
text: "A selection of everyday things, chosen to last.",
action: {
label: "Explore the shop",
action: "catalog"
},
items: [
{
id: "sneaker-rouge",
name: "Red sneaker",
price: 9500,
image: "https://images.unsplash.com/photo-1518366352543-6609db5ccdef?w=1600&q=80",
images: [
"https://images.unsplash.com/photo-1518366352543-6609db5ccdef?w=1600&q=80",
"https://images.unsplash.com/photo-1650320079970-b4ee8f0dae33?w=1600&q=80"
],
alt: "A red sneaker on a plain background"
},
{
id: "tabouret",
name: "Ash stool",
price: 12900,
image: "https://images.unsplash.com/photo-1503602642458-232111445657?w=1600&q=80",
alt: "A light wood stool on a blue background"
}
],
options: {
open: "product",
eyebrow: "New collection"
}
}
</script>
<template>
<HeroFloatOrbit v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe shop’s promise, 2 to 7 words: set very large |
| items | Item[] | Datathe products whose pictures float (the catalogue’s featured products); the first four with a picture are shown |
| text | string | Wordsone sentence under the title |
| action | Action | the call to action: its words and the page action it runs |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Item items[] · 19 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | Datathe record’s id in the tool that answers it |
| name* | string | Wordsthe product’s name |
| price* | number | an amount in cents |
| compareAt | number | the price before the merchant’s reduction |
| currency | string | DesignISO 4217, EUR by default |
| image | string | null | Picturethe main picture; null or absent: the product has none yet |
| images | string[] | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| alt | string | Wordswhat the main picture shows |
| brand | string | Wordsthe brand or maker |
| category | string | Wordsthe product’s category, e.g. "Knitwear" |
| summary | string | Wordsone short line on the product |
| badge | string | Wordsa short tag the merchant set ("New", "Handmade") |
| rating | number | the average of the shop’s own stored reviews |
| reviewCount | number | how many stored reviews the rating averages |
| available | boolean | false: sold out; true or absent: can be bought |
| stock | number | the real stock, when the merchant shows it |
| maxQuantity | number | the most one order may hold of it, as the merchant set it (one per customer, a limited run) |
| options | Option[] | the product’s options and their values, e.g. sizes |
| highlights | Highlight[] | a few key facts the merchant set, shown on the product’s card |
Option items[].options[] · 2 props
| Prop | Type | Description |
|---|---|---|
| name* | string | Wordsthe option’s name, e.g. "Size" |
| values* | string[] | Wordsits values, e.g. "S", "M", "L" |
Highlight items[].highlights[] · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe property ("Material", "Capacity") |
| value* | string | Wordsits value, as the merchant states it ("Washed linen", "50 cl") |
Action action · 3 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordswhat happens ("Discover the shop") |
| action* | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action opens, if any |
Options options · 4 props
| Prop | Type | Description |
|---|---|---|
| images | Image[] | pictures given by hand instead of items: each a product on a plain ground |
| open | string | Actionthe action a product’s picture runs, with its record (a product page) |
| eyebrow | string | Wordsa few words above the title (the shop’s trade, its place) |
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a band of the page that redefines the theme surfaces inside it |
Image options.images[] · 2 props
| Prop | Type | Description |
|---|---|---|
| src* | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| alt* | string | Wordsthe product the picture shows |
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:
action,options.open - Reads
productsfrom your app
A hero section, for home pages; it uses class-variance-authority, clsx, motion, reka-ui, tailwind-merge.
More hero blocks
- Event poster: the title set as a poster over a picture, the details in a ruled strip below: a festival, an exhibition, a season.
- Event replay on demand: a past event: a one-line recap and the replay action, never a register button; without a replay it is the recap alone.
- Figures stat band: a number is the argument: a bordered band of three to five figures the merchant states.
- Finder: a product choice that needs a few questions: the first question shown, the real finder one click away.
- Flows workflow tabs: a product explained by its flows: centred words over a tab row, each tab a short chain of steps.
- Form card: the promise and what the visitor gets on one side, a framed form panel on the other: a quote or a demo that asks a few questions.
- Globe beside: a team, a network of makers or depots, with more to say: the words at the left and a whole dotted globe at the right, its first places named on leaders; the merchant’s own places only.
- Globe rising: a brand whose argument is where it makes or ships, told in few words: the words centred over a large dotted hemisphere rising from the bottom edge, its pins named on hover and listed under it; the merchant’s own places only.