Signup popup picture beside — Newsletter block
Freenewsletter-signup-popup-picture-beside · for home, catalog pages
Signup popup picture beside
A picture and signup form inside the host's dialog; 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/newsletter-signup-popup-picture-besideUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import NewsletterSignupPopupPictureBeside from '@/components/trame/blocks/newsletter/newsletter-signup-popup-picture-beside.vue'
const props = {
title: "News from the workshop",
lead: "Get our making-of notebooks and the newest pieces.",
image: {
src: "https://images.unsplash.com/photo-1775129667571-7fa3f51c05e3?w=1600&q=80",
alt: "A desk with a candle, an open notebook and a fountain pen"
},
submit: {
label: "Get the notebook",
action: "subscribe"
},
consent: "I’d like to get news from the workshop by email.",
terms: "You can unsubscribe from any message.",
dismissLabel: "Keep browsing",
rememberLabel: "Don’t show me this sign-up again"
}
</script>
<template>
<NewsletterSignupPopupPictureBeside v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe section’s heading |
| lead | string | Wordsa sentence or two under the heading |
| code | string | Wordsthe merchant’s real fixed code |
| image | Image | a picture beside the form |
| terms | string | Wordsthe merchant’s actual offer terms or subscription explanation |
| submit* | Submit | the submit action: its words and the page action it runs |
| consent | string | Wordsexplicit subscription consent, never preselected |
| dismissLabel | string | Wordsthe close button’s words, instead of the block’s own |
| rememberLabel | string | Wordsthe words beside a "do not show again" box; absent: no box |
| status | string | Wordsserver response, never inferred from a click |
| error | string | Wordsthe host’s refusal, shown under the form |
| busy | boolean | true: the host is sending the form; the button shows it |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Image image · 2 props
| Prop | Type | Description |
|---|---|---|
| src* | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| alt | string | Wordswhat the picture shows, when the words do not say it |
Submit submit · 2 props
| Prop | Type | Description |
|---|---|---|
| label* | string | Wordsthe words on the button or link |
| action* | string | Actionsubscribes the e-mail typed |
Options options · 1 props
| Prop | Type | Description |
|---|---|---|
| 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 |
| asset | a picture’s address as your app serves it |
| 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
A newsletter 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 newsletter blocks
- Letter signup signed: a letter written by one person: their note and their face beside the form, for an editorial tone.
- Pictured signup: editorial or lifestyle shops: a picture the full height of the block, the form on its other side.
- Production signup stepped: a batch in the making: the form beside its stages, with the one in progress marked — the merchant’s own only.
- Release signup split date: a single dated release: its date set large, what is in it, the form beside it — the merchant’s own only.
- Signup guide numbered: the signup deserves its rules told: the form above, the mechanics as numbered columns below — the merchant’s own only.
- Signup statement centered: a newsletter, waitlist or early-access call that is the section’s whole point: the collage title very large and centred, the field and its button as one pill row, the count under it.
- Signup statement split: the same call closing a long page or beside other content: the collage title start-aligned over two thirds, the form and the count in a card on the end side.
- Signup strip: one row of words, field and button at the end of an article, asking for nothing more.