Restock notify inline row — Storefront block

Pro

storefront-restock-notify-inline-row · for product, home, catalog pages

Restock notify inline row

A product page or a sold-out list: one compact row per sold-out variant with its own field and bell button

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-restock-notify-inline-row

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import StorefrontRestockNotifyInlineRow from '@/components/trame/blocks/storefront/storefront-restock-notify-inline-row.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.",
submitLabel: "Notify me",
notifyAction: "restock.notify",
title: "Let me know when it’s back",
options: {
requestsLabel: "{count} people are waiting for this style",
noDateLabel: "No date yet"
},
variants: [
{
id: "s0",
label: "36",
soldOut: true,
note: "Back November 12"
},
{
id: "s1",
label: "37",
soldOut: false
}
]
}
</script>

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

Props

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

PropTypeDescription
product*ProductDatathe sold-out product (a record of the shop)
nextDatestringDatawhen the item is back, in the merchant’s own words ("Expected back mid-November"); absent when the merchant has no date
requestsnumberDatahow many people asked to be told, from the shop’s own data
variantsVariant[]Datathe sizes or colours of the product with their real stock state
titlestringWordsthe heading ("Tell me when it is back"); the product’s name when absent
stateLabel*stringWordshow a sold-out item is named ("Sold out")
policy*stringWordswhat happens to the address, as the shop states it ("A single email, address deleted afterwards")
submitLabel*stringWordswhat the button does ("Notify me")
notifyAction*stringActionthe page action that receives the address (posted by the form)
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Product product · 4 props
PropTypeDescription
id*string | numberDatathe record’s id in the tool that answers it
name*stringWordsthe product’s name
imagestring | nullPicturethe main picture; null or absent: the product has none yet
altstringWordswhat the main picture shows
Variant variants[] · 4 props
PropTypeDescription
id*string | numberthe variant’s id
label*stringthe size or colour
soldOut*booleantrue: this variant is sold out
notestringwhat the shop knows about it ("Back on 12 November")
Options options · 3 props
PropTypeDescription
requestsLabelstringWordshow the number of requests is said, {count} standing for it ("{count} people waiting")
noDateLabelstringWordswhat is said when the shop has no date ("No date yet")
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
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: notifyAction
  • Reads products from 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

  • Rental dates inline: a wide booking bar: two date fields, the extras and the total side by side: a rental page where the dates are the first question.
  • Repeat order table: a buyer who orders the same things each season: the last order laid out to repeat, then adjust.
  • Request status steps: a request waiting on someone: the steps so far, who decides, and what the customer can do meanwhile.
  • Restock notice email form: a sold-out category: the merchant’s restocks and an email field to be told.
  • Retired products rows: products no longer made with their years, quantity and reason: an honest page about what was stopped.
  • Return request stepped: the request on one page in three numbered steps (items, reason, way back), a summary beside it.
  • Returning order review bag first: a signed-in customer: the bag first, saved address and card as rows, and who is signed in at the top.
  • Review form card: one form card with the product named on top: under the reviews of a product page, or on a page of its own.

All 409 storefront blocks