Offer popup slide in — Storefront block

Pro

storefront-offer-popup-slide-in · for home, catalog pages

Offer popup slide in

A compact nonblocking card positioned by the host; the merchant's own offer 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-offer-popup-slide-in

Usage

Its demo data, shortened (Using blocks).

<script setup lang="ts">
import StorefrontOfferPopupSlideIn from '@/components/trame/blocks/storefront/storefront-offer-popup-slide-in.vue'

const props = {
title: "News from the workshop",
lead: "Get our making-of notebooks and the new pieces.",
submit: {
label: "Get the notebook",
action: "subscribe"
},
consent: "I’d like to receive news from the workshop by email.",
terms: "You can unsubscribe from any message.",
dismissLabel: "Continue browsing",
rememberLabel: "Don’t offer me this sign-up again"
}
</script>

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

Props

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

PropTypeDescription
title*stringWordsthe section’s heading
leadstringWordsa sentence or two under the heading
codestringWordsthe merchant’s real fixed code
termsstringWordsthe merchant’s actual offer terms or subscription explanation
submitSubmitthe submit action: its words and the page action it runs
consentstringWordsexplicit subscription consent, never preselected
dismissLabelstringWordsthe close button’s words, instead of the block’s own
rememberLabelstringWordsthe words beside a "do not show again" box; absent: no box
statusstringWordsserver response, never inferred from a click
errorstringWordsthe host’s refusal, shown under the form
busybooleantrue: the host is sending the form; the button shows it
optionsOptionsthe block’s settings: layout choices and secondary words, read by every variant
Submit submit · 2 props
PropTypeDescription
label*stringWordsthe words on the button or link
action*stringActionsubscribes the e-mail typed
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
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

A storefront section, for 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

  • Menu classic: a written menu for a table that reads: sections in two columns, each dish with its price at the end of a dotted line.
  • Menu pictured: a menu that sells by the picture: dishes as cards with their photo, for a kitchen with good photos of most plates.
  • Mini cart compact: a short cart on a page of its own, or a mini-cart panel: small rows in one bordered card, the total and the way to pay held in its footer.
  • 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.
  • Offers panel drawer: a slim band naming the offers that opens a side sheet of picture rows, sides alternating: several offers worth a look without taking the page; the merchant’s own offers only.
  • Offers panel inline strip: the offers as a row of cards on the page, scrolling sideways past three: when no overlay is wanted; the merchant’s own offers only.
  • 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.
  • 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.

All 409 storefront blocks