Staaarter

Back in Stock Notification

A back-in-stock notice for an unavailable product: a photo, name, and "Currently unavailable" badge, an email and optional SMS signup form, and a waitlist counter. Submitting the form genuinely swaps it for a confirmation message, no email is actually sent.

By Staaarter Team
Ecommerce
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button, badge, media-slot dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/back-in-stock-notification.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/ecommerce/ecommerce22.tsx instead.

Usage

The file also exports ecommerce22Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Ecommerce22, ecommerce22Demo } from "@/components/blocks/ecommerce/ecommerce22";

export default function Page() {
  return <Ecommerce22 {...ecommerce22Demo} />;
}

Props

PropTypeDefaultDescription
productNamestringnoneProduct name shown next to the thumbnail.
productImageMediaSlotImageundefinedProduct thumbnail; falls back to a centered Package icon when omitted.
waitlistCountnumbernoneNumber shown in the "N people are waiting" caption.
classNamestringnoneExtra classes for the outer section element.

Types

type MediaSlotImage = { src: string; alt: string };

Behavior notes

  • Submitting the form is genuinely validated client-side: it requires the email field to contain both "@" and "." before accepting it, showing an inline error otherwise. On a valid submit, real useState swaps the form out for a confirmation message quoting the typed email back ("We'll email you at {email}..."). No email is actually sent and no signup is stored anywhere; this is local UI state only.
  • The optional SMS phone input has no validation of its own and isn't referenced in the confirmation message, it's collected but not otherwise used in this demo.
  • waitlistCount is a static prop, it doesn't increment when the demo form is submitted.