Offers panel launcher stack — Storefront block

Free

storefront-offers-panel-launcher-stack · for home, catalog, cart pages

Offers panel launcher stack

A small pill fixed at the bottom corner with the count, opening a compact card of thumbnail rows: offers always at hand on a catalogue or cart page; the merchant’s own offers only

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-offers-panel-launcher-stack

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import StorefrontOffersPanelLauncherStack from '@/components/trame/blocks/storefront/storefront-offers-panel-launcher-stack.vue'

const props = {
title: "Current offers",
lead: "The workshop’s discounts and extras, while they last.",
offers: [
{
title: "Free shipping over $60",
text: "Within the contiguous US, every piece wrapped in recycled paper.",
image: "https://images.unsplash.com/photo-1607166452427-7e4477079cb9?w=1200&q=80",
alt: "A closed kraft cardboard box on a white background",
label: "Visit the shop",
action: "catalog"
},
{
title: "Buy two bowls, get the third half price",
text: "On all speckled stoneware bowls; the discount applies in the cart.",
image: "https://images.unsplash.com/photo-1530006498959-b7884e829a04?w=1200&q=80",
alt: "Two speckled white stoneware bowls stacked on a dark background",
label: "See the bowls",
action: "category",
record: {
id: "bols"
}
}
]
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe panel’s name ("Current offers")
leadstringWordsone sentence under the title
offers*Offer[]the merchant’s real current offers, 1 to 12
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Offer offers[] · 8 props
PropTypeDescription
title*stringWordsthe offer as the merchant states it ("Free delivery from €60")
textstringWordsone line of conditions ("Across the whole shop, in mainland France")
imagestringPicturea picture: a root-relative path (/media/…) or an absolute URL
altstringWordswhat the picture shows
label*stringWordsthe button’s words ("See the bowls")
action*stringActionthe page the offer leads to
recordRecord<string, unknown>Datathe record the action opens, if any
endsAtstringWordsthe end date the merchant gives, as written ("Until 24 December"); never a countdown
Options options · 1 props
PropTypeDescription
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
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
  • Subtle motion: one short reveal; still under reduced motion
  • Real buttons and links, a visible focus
  • Asks your app through actions: offers[]

A storefront section, for home, catalog, cart pages; it uses @lucide/vue, @vueuse/core.

Built with

The components this block is made of; each one installs on its own too.

More storefront blocks

  • Mini cart receipt: a short cart with character, for a shop with a crafted or retro voice: a narrow till-receipt ticket, each line running to its price along a dotted leader, the total under a double rule.
  • Offer popup code: A centered selectable code with its terms in the host's dialog; the merchant's own offer only.
  • Offer popup slide in: A compact nonblocking card positioned by the host; the merchant's own offer only.
  • Open books cost breakdown: lines with their amount and a thin proportional bar, and the total: where the price of a product goes; the merchant’s own only.
  • Order confirmation card: one centred card with the order, its delivery and its actions: the default after a payment.
  • Order confirmation receipt: the order’s four facts side by side above its lines and totals: a customer who wants the record at a glance.
  • Order confirmation table: a bordered panel with the order’s header and a table of items: orders with many lines or a delivery date per line.
  • Order detail sheet: a side sheet over the order list, closed back to it: opening one order without leaving the history.

All 409 storefront blocks