Stock alert status card — Storefront block
Prostorefront-stock-alert-status-card · for product, home, catalog pages
Stock alert status card
After signing up, when the shop’s system returns a place in the queue: where the visitor stands and what happens next
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-stock-alert-status-cardUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import StorefrontStockAlertStatusCard from '@/components/trame/blocks/storefront/storefront-stock-alert-status-card.vue'
const props = {
product: {
id: "runner-02",
name: "Canvas city sneakers",
image: "https://images.unsplash.com/photo-1518366352543-6609db5ccdef?w=1600&q=80",
alt: "A pair of red sneakers against a red background"
},
nextDate: "Expected back mid-November",
requests: 240,
stateLabel: "Sold out",
policy: "One email when it’s back in stock, then your address is deleted.",
notifyAction: "restock.notify",
title: "Let me know when it’s back",
options: {
requestsLabel: "{count} people are waiting for this style",
noDateLabel: "No date yet",
positionLabel: "You’re #{rank} of {total}",
nextText: "As soon as the style is back, we’ll email you once, in list order."
},
position: {
rank: 42,
total: 240
}
}
</script>
<template>
<StorefrontStockAlertStatusCard v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| product* | Product | Datathe sold-out product (a record of the shop) |
| nextDate | string | Datawhen the item is back, in the merchant’s own words ("Expected back mid-November"); absent when the merchant has no date |
| requests | number | Datahow many people asked to be told, from the shop’s own data |
| position* | Position | Datathe visitor’s place in the queue, only when the shop’s system returns it |
| title | string | Wordsthe heading ("Tell me when it is back"); the product’s name when absent |
| stateLabel* | string | Wordshow a sold-out item is named ("Sold out") |
| policy* | string | Wordswhat happens to the address, as the shop states it ("A single email, address deleted afterwards") |
| notifyAction* | string | Actionthe page action that receives the address (posted by the form) |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Product product · 4 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | Datathe record’s id in the tool that answers it |
| name* | string | Wordsthe product’s name |
| image | string | null | Picturethe main picture; null or absent: the product has none yet |
| alt | string | Wordswhat the main picture shows |
Position position · 2 props
| Prop | Type | Description |
|---|---|---|
| rank* | number | the customer’s place in the queue |
| total | number | how many are in the queue |
Options options · 5 props
| Prop | Type | Description |
|---|---|---|
| requestsLabel | string | Wordshow the number of requests is said, {count} standing for it ("{count} people waiting") |
| noDateLabel | string | Wordswhat is said when the shop has no date ("No date yet") |
| positionLabel | string | Wordsthe queue place, {rank} and {total} standing for the figures ("You are no. {rank} of {total}") |
| nextText | string | Wordswhat happens next once the visitor is in the queue |
| 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 |
| 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
- Subtle motion: one short reveal; still under reduced motion
- Real buttons and links, a visible focus
- Asks your app through actions:
notifyAction - Reads
productsfrom your app
A storefront section, for product, home, catalog pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, reka-ui, tailwind-merge.
Built with
The components this block is made of; each one installs on its own too.
More storefront blocks
- Size fit picker: a shopper who already hesitates between two or three sizes: the sizes as chips, the chosen one shows each measurement large with where it sits in the merchant’s own range; reads well on a phone where a wide table does not.
- Spec revisions ledger: one row per change: the old value struck, the new one, and why: a product that changed between versions; the merchant’s own changes only.
- Specification figures ledger: a long specification (furniture, appliances, tech): each group a titled chapter, its rows joined to their values by a dotted leader, like a printed data sheet.
- Stage timeline: a service that takes time (repair, mail-in, cross-border delivery): the stages with their durations, the deciding one marked.
- Store rating band: A broad download band pairs store links with the merchant’s own sourced rating only, for an established app.
- Styled three ways: the same piece in three scenes, each with its own pieces, the constant piece under them: one piece, three lives.
- Subscription plans feature offer: one formula told large with its picture, the other formulas as a slim list beneath: a favourite among several.
- Subscription plans offer rows: two to six formulas as wide ruled rows (name, cadence, contents in a line, price, action): a long list read like a menu.