Welcome offer led — Storefront block

Pro

storefront-welcome-offer-led · for home, landing, article, product pages

Welcome offer led

A welcome offer is traded for the address: the offer as the headline, the form beside it

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-welcome-offer-led

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import StorefrontWelcomeOfferLed from '@/components/trame/blocks/storefront/storefront-welcome-offer-led.vue'

const props = {
title: "One letter a month, no noise",
lead: "News from the workshop, behind-the-scenes making and restocks, before they go online.",
perks: [
"First look at new pieces",
"One care tip per issue"
],
offerLabel: "10% off your first order",
consent: "Your address is used only to send you this letter. Unsubscribe in one click, any time.",
submitLabel: "Subscribe",
subscribeAction: "newsletter.subscribe",
privacyAction: "page.privacy",
privacyLabel: "Privacy policy",
options: {
frequency: "One email a month",
perksTitle: "What you get",
avoidTitle: "What we don’t do",
avoid: [
"We never share your address",
"No daily reminders"
]
}
}
</script>

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

Props

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

PropTypeDescription
title*stringWordswhat the visitor gets for their address ("One letter a month, new arrivals before anyone else")
leadstringWordsone or two sentences on what the mail contains
perksstring[]Wordsone thing the visitor receives
consent*stringWordsthe purpose of the address and the right to leave, as the merchant states it, next to the field
submitLabel*stringWordswhat the button does ("Subscribe")
offerLabel*stringWordsthe welcome offer, exactly as the merchant set it ("10% off the first order")
subscribeAction*stringActionthe page action that receives the address (posted by the form)
privacyActionstringActionthe page that states how the address is used
privacyLabelstringWordsthe privacy link’s words ("Privacy policy")
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Options options · 8 props
PropTypeDescription
frequencystringWordshow often the merchant writes ("One email a month")
countstringWordsthe number of readers, only when the merchant states it ("1,200 readers")
avoidstring[]Wordsone thing the merchant does not do ("Your address is never shared")
avoidTitlestringWordsthe heading above `avoid` ("What we do not do")
perksTitlestringWordsthe heading above `perks` ("What you receive")
status'success' | 'error'Datathe answer to the last submission, when the host re-renders the page with it
statusTextstringWordswhat that answer says, in the merchant’s or the shop’s words
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
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: subscribe, privacyAction

A storefront section, for home, landing, article, product pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, motion, reka-ui, tailwind-merge.

More storefront blocks

  • Usage guide schedule: A practical table of timing, task, product and optional steps; the merchant's own guidance only.
  • Variant stock alert grid: a product with many sizes or colours: a grid showing each one’s state, the sold-out ones can be ticked for one alert.
  • Viewed products compact rail: small compact cards in a tight rail: the "Recently viewed" section on a product or cart page.
  • Vote ballot: A list of candidates and supplied standings with a vote action; the merchant's own votes and dates only.
  • Wishlist alerts beside list: the alert settings beside the watched products: a customer who wants to choose what they are told.
  • Wishlist board: a long list of things to look at, not to compare: a moodboard of pictures at their own proportions with the actions on the picture (a fashion or decoration shop).
  • Wishlist grid: product cards with a way off the list and a way to the cart: the default for any shop.
  • Wishlist popover: the header’s heart and the small panel it opens: each saved product in a line with its price, a way to the cart and a way off the list, the panel scrolling past a few: a shop header, where the list is checked between two pages.

All 409 storefront blocks