Float orbit — Hero block

Pro

hero-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-orbit

Usage

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.

PropTypeDescription
title*stringWordsthe shop’s promise, 2 to 7 words: set very large
itemsItem[]Datathe products whose pictures float (the catalogue’s featured products); the first four with a picture are shown
textstringWordsone sentence under the title
actionActionthe call to action: its words and the page action it runs
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Item items[] · 19 props
PropTypeDescription
id*string | numberDatathe record’s id in the tool that answers it
name*stringWordsthe product’s name
price*numberan amount in cents
compareAtnumberthe price before the merchant’s reduction
currencystringDesignISO 4217, EUR by default
imagestring | nullPicturethe main picture; null or absent: the product has none yet
imagesstring[]Picturea picture: a root-relative path (/media/…) or an absolute URL
altstringWordswhat the main picture shows
brandstringWordsthe brand or maker
categorystringWordsthe product’s category, e.g. "Knitwear"
summarystringWordsone short line on the product
badgestringWordsa short tag the merchant set ("New", "Handmade")
ratingnumberthe average of the shop’s own stored reviews
reviewCountnumberhow many stored reviews the rating averages
availablebooleanfalse: sold out; true or absent: can be bought
stocknumberthe real stock, when the merchant shows it
maxQuantitynumberthe most one order may hold of it, as the merchant set it (one per customer, a limited run)
optionsOption[]the product’s options and their values, e.g. sizes
highlightsHighlight[]a few key facts the merchant set, shown on the product’s card
Option items[].options[] · 2 props
PropTypeDescription
name*stringWordsthe option’s name, e.g. "Size"
values*string[]Wordsits values, e.g. "S", "M", "L"
Highlight items[].highlights[] · 2 props
PropTypeDescription
label*stringWordsthe property ("Material", "Capacity")
value*stringWordsits value, as the merchant states it ("Washed linen", "50 cl")
Action action · 3 props
PropTypeDescription
label*stringWordswhat happens ("Discover the shop")
action*stringActiona named action of the page
recordRecord<string, unknown>Datathe record the action opens, if any
Options options · 4 props
PropTypeDescription
imagesImage[]pictures given by hand instead of items: each a product on a plain ground
openstringActionthe action a product’s picture runs, with its record (a product page)
eyebrowstringWordsa few words above the title (the shop’s trade, its place)
mood'inverse' | 'brand' | 'warm' | 'tint' | stringa band of the page that redefines the theme surfaces inside it
Image options.images[] · 2 props
PropTypeDescription
src*stringPicturea picture: a root-relative path (/media/…) or an absolute URL
alt*stringWordsthe 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).

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
  • 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 products from 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.

All 102 hero blocks