Signup inline — Banner block
Freebanner-signup-inline · for home, catalog, product, article, landing pages
Signup inline
One strip above the header, the line and the offer beside the email field and its button: a standing invitation on every page of a shop or a magazine
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/banner-signup-inlineUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import BannerSignupInline from '@/components/trame/blocks/banner/banner-signup-inline.vue'
const props = {
message: "Join the list for new colours and restocks.",
offer: "10% off your first order",
action: "newsletter.subscribe",
button: "Get my code",
placeholder: "[email protected]",
consent: "One email a fortnight. Unsubscribe in one click.",
privacy: {
label: "Privacy",
action: "page.privacy"
},
success: "Your code is on its way: check your inbox."
}
</script>
<template>
<BannerSignupInline v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| message* | string | Wordsthe line the bar says, in the merchant’s words, e.g. "Join the list for early access to new colours" |
| offer | string | Wordswhat subscribing gives, as the merchant offers it, e.g. "10% off your first order"; absent: no offer is shown |
| endsAt | string | Datawhen the merchant’s offer really ends, with its offset; shown as a date; once it has passed the offer goes and the plain invitation stays |
| action* | string | Actionsubscribes the address; the bar is hidden when the page lacks it |
| button | string | Wordsthe button’s words, e.g. "Get my code" |
| placeholder | string | Wordsa hint in the empty field, e.g. "[email protected]" |
| consent | string | Wordsone short line on what the visitor agrees to, e.g. "One email a week. Unsubscribe in one click." |
| privacy | Privacy | the merchant’s privacy page |
| success | string | Wordswhat the bar says once subscribed, e.g. "Your code is on its way: check your inbox" |
| dismissible | boolean | false keeps the bar without its close button; it can be closed by default |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Privacy privacy · 4 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe link’s words, e.g. "See the collection" |
| action | string | Actiona named action of the page |
| record | Record<string, unknown> | Datathe record the action applies to, passed to the host with it, if any |
| url | string | Designan address outside the app |
Options options · 2 props
| Prop | Type | Description |
|---|---|---|
| asOf | string | Designthe instant the page is rendered (ISO 8601 date-time), so the server knows whether the offer has ended; absent, the browser checks once loaded |
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a 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).
| Member | What it is for |
|---|---|
| href | the address an action leads to, or null to hide what leads there |
| act | runs a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error } |
| can | whether the page has this action |
| Link | your router’s link component |
| cartCount | the cart badge’s number |
| cartDrawer | whether your app has a cart drawer |
| cartOpen | whether the cart drawer is open |
| label | your 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:
| Key | English | French |
|---|---|---|
| newsletter.already | You are already subscribed. | Vous êtes déjà inscrit. |
| newsletter.done | Done: you are subscribed. | C’est noté : vous êtes inscrit. |
| newsletter.invalid | Check the email address. | Vérifiez l’adresse e-mail. |
| newsletter.tooMany | Too 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,privacy
A banner section, for home, catalog, product, article, landing 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 banner blocks
- Announcement top bar: the usual strip above the header: one sentence and a link, for a promotion or a piece of news.
- Change notice disclosure: a price or policy change that needs up to three facts: a headline that opens a short panel.
- Countdown cutoff line: the delivery promise, to the minute ("Order within 3 h 12 min for delivery on …"): the shop’s real last order time for a date.
- Countdown inline digits: one quiet centred line with the time left as digits: the end of a sale the merchant really set, above the header.
- Countdown unit boxes: the time left as boxed days, hours, minutes and seconds beside the message: a short sale or a launch the merchant wants seen.
- Free shipping progress: the shop has a free-shipping rule: a progress bar reading the cart’s total, or the rule alone without a cart.
- Promotional marquee: a slim band in the brand’s colour, the offer passing in a row: a short offer between two sections; the merchant’s own only.
- Store notice card: a bordered card inside the page: a delay, a store notice, a region suggestion with its button.