Letter signup signed — Newsletter block
Pronewsletter-letter-signup-signed · for home, landing, article, product pages
Letter signup signed
A letter written by one person: their note and their face beside the form, for an editorial tone
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-letter-signup-signedUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import NewsletterLetterSignupSigned from '@/components/trame/blocks/newsletter/newsletter-letter-signup-signed.vue'
const props = {
title: "One letter a month, no noise",
lead: "The workshop’s new pieces, behind-the-scenes making and restocks, before they go online.",
perks: [
"Early access to new pieces",
"One care tip per issue"
],
author: {
name: "Ivy Marchand",
role: "Seamstress at the workshop",
note: "I write about what the workshop learns: a cut we tried, a wool we found, a mistake we own. One email a month, no more."
},
consent: "Your address is only used to send you this letter. Unsubscribe in one click, anytime.",
submitLabel: "Subscribe",
subscribeAction: "newsletter.subscribe",
privacyAction: "page.privacy",
privacyLabel: "Privacy policy",
options: {
frequency: "One email a month",
authorLabel: "A word from the writer"
},
offerLabel: "10% off your first order"
}
</script>
<template>
<NewsletterLetterSignupSigned v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordswhat the visitor gets for their address ("One letter a month, new arrivals before anyone else") |
| lead | string | Wordsone or two sentences on what the mail contains |
| perks | string[] | Wordsone thing the visitor receives |
| consent* | string | Wordsthe purpose of the address and the right to leave, as the merchant states it, next to the field |
| submitLabel* | string | Wordswhat the button does ("Subscribe") |
| offerLabel | string | Wordsthe welcome offer, exactly as the merchant set it ("10% off the first order") |
| subscribeAction* | string | Actionthe page action that receives the address (posted by the form) |
| privacyAction | string | Actionthe page that states how the address is used |
| privacyLabel | string | Wordsthe privacy link’s words ("Privacy policy") |
| author* | Author | who writes the letter |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Author author · 4 props
| Prop | Type | Description |
|---|---|---|
| name* | string | Wordswho writes the letter |
| role | string | Wordstheir role ("Seamstress at the workshop") |
| avatar | string | Picturethe writer’s portrait |
| note* | string | Wordsa short note in their own words, why they write it |
Options options · 6 props
| Prop | Type | Description |
|---|---|---|
| frequency | string | Wordshow often the merchant writes ("One email a month") |
| count | string | Wordsthe number of readers, only when the merchant states it ("1,200 readers") |
| authorLabel | string | Wordsthe words above the writer’s note ("A word from the writer") |
| status | 'success' | 'error' | Datathe answer to the last submission, when the host re-renders the page with it |
| statusText | string | Wordswhat that answer says, in the merchant’s or the shop’s words |
| 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 |
| 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,privacyAction
A newsletter section, for home, landing, article, product pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, motion, reka-ui, tailwind-merge.
More newsletter blocks
- Issue preview split preview: the merchant has a real newsletter: the form beside a card showing what an issue looks like.
- Journal signup with issues: the journal has already gone out: the form beside its last issues, as proof of what arrives.
- Latest issue signup cover card: the latest issue shown as a cover card beside the form: one strong issue to sell the next ones.
- Letter archive collage: an intro with a collage of the merchant’s pictures and the form, a sample archive beside it: one letter with a real history.
- 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.