Preorder timeline steps — Storefront block

Pro

storefront-preorder-timeline-steps · for product, home, catalog pages

Preorder timeline steps

When the payment plan is the doubt (a deposit, a balance at shipping): the product small above, each step of the order drawn with its date and amount

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/storefront-preorder-timeline-steps

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import StorefrontPreorderTimelineSteps from '@/components/trame/blocks/storefront/storefront-preorder-timeline-steps.vue'

const props = {
product: {
id: "veste-brume",
name: "Mist windbreaker jacket",
price: 24900,
image: "https://images.unsplash.com/photo-1591047139829-d91aecb6caea?w=1600&q=80",
alt: "An orange windbreaker on a hanger",
summary: "Lightweight nylon, ribbed collar and cuffs, two zip pockets. A single color for this first run."
},
title: "Preorder the Mist jacket",
expectedDate: "Ships from November 18",
payNow: 5000,
laterLabel: "The $199 balance is charged the day it ships, not before.",
made: 300,
schedule: [
{
id: "order",
label: "You preorder",
date: "Today",
amount: 5000,
note: "A deposit, charged right away."
},
{
id: "make",
label: "The workshop cuts and sews the run",
date: "October and early November"
}
],
action: "preorder.place",
actionLabel: "Preorder for $50",
policy: "Cancel free of charge, with your deposit refunded, until the day it ships.",
options: {
eyebrow: "Preorder",
nowLabel: "Today",
madeLabel: "{count} made for this run"
}
}
</script>

<template>
<StorefrontPreorderTimelineSteps v-bind="props" />
</template>

Props

Each prop says who changes it: Words, Picture, Action, Design, Data.* required.

PropTypeDescription
product*ProductDatathe product open to pre-order; its price is the full price, in cents
titlestringWordsthe heading ("Preorder the Brume jacket"); the product’s name when absent
expectedDate*stringWordswhen it ships, in the merchant’s own words ("Shipping from 18 November"): never computed
payNow*numberDatawhat the customer pays today, in cents; the full price when the merchant charges everything now
laterLabelstringWordswhen and how the rest is charged ("The balance is charged on the day of shipping"); absent when everything is paid now
madenumberDatahow many were made, only when the merchant says so
scheduleSchedule[]Datathe steps from the order to the delivery, in order, as the merchant plans them
action*stringActionthe page action that places the pre-order (posted as a form)
actionLabelstringWordswhat the button says ("Preorder")
policystringWordsthe merchant’s terms ("Free cancellation until shipping")
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Product product · 7 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
imagestring | nullPicturethe main picture; null or absent: the product has none yet
altstringWordswhat the main picture shows
summarystringWordsone short line on the product
Schedule schedule[] · 5 props
PropTypeDescription
id*stringthe schedule’s id
label*stringWordswhat happens ("Your card is charged the deposit")
datestringWordswhen, as the merchant wrote it ("Today", "Mid-October")
amountnumberwhat is charged at this step, if any
notestringWordsa short note on the schedule
Options options · 4 props
PropTypeDescription
eyebrowstringWordsthe tag ("Preorder")
nowLabelstringWordsthe name of the payment made today ("Today")
madeLabelstringWordshow the number made is said, {count} standing for it ("{count} copies made")
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
moneyformats a price, given in cents
asseta picture’s address as your app serves it
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: action
  • Reads products from your app

A storefront section, for product, home, catalog pages; it uses @lucide/vue, 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 storefront blocks

  • Points rewards affordable first: The customer has points to spend: the rewards to redeem, those they can afford first, the balance always in view.
  • Preorder banner: a pre-order announced between two sections or above a product page: the picture, the date, what is paid now, one button.
  • Preorder product split: the pre-order is the page’s subject: a large picture beside the date, the two payments side by side and the terms.
  • Preorder products cards: a ship window, a reserved-of-total meter and a reserve button: a limited run in preorder; the merchant’s own products and figures only.
  • Price breakdown ruled bars: a ruled ledger, each line with its amount and a thin bar of its weight: the honest account of one price.
  • Price breakdown stacked bar: one segmented bar and its legend: 3 to 6 lines read at a glance.
  • Price routes two ledgers: two short ledgers, the usual route against selling direct, ending in two totals: a brand selling direct.
  • Price story figures: a short account, three or four key figures and a closing sentence, no ledger: reasons that are not only cost.

All 409 storefront blocks