Signup strip — Newsletter block
Pronewsletter-signup-strip · for article, journal pages
Signup strip
One row of words, field and button at the end of an article, asking for nothing more
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-stripUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import NewsletterSignupStrip from '@/components/trame/blocks/newsletter/newsletter-signup-strip.vue'
const props = {
title: "The workshop journal, one issue a month",
lead: "One long read, three finds and news from the workshop. Nothing else.",
submit: "subscribe",
submitLabel: "Get the journal",
consent: "Your address is only used to send you the journal. Every issue includes an unsubscribe link.",
options: {
eyebrow: "The journal",
frequency: "One issue a month"
}
}
</script>
<template>
<NewsletterSignupStrip v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordswhat the reader gets by subscribing ("The workshop journal, once a month") |
| lead | string | Wordsthe promise in one or two sentences: what each issue contains |
| submit* | string | Actionthe page action that receives the address (posted by the form) |
| submitLabel* | string | Wordswhat the button does ("Get the journal") |
| consent* | string | Wordsthe purpose of the address and how to leave, as the merchant states it, next to the field |
| subscriberCount | number | Datathe number of readers, only when the merchant counts and states it |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Options options · 5 props
| Prop | Type | Description |
|---|---|---|
| eyebrow | string | Wordswhat the journal is ("The journal") |
| frequency | string | Wordshow often it is sent, as the merchant writes it ("One issue a month") |
| status | 'success' | 'error' | Datathe answer to the last submission, when the host re-renders the page with it |
| statusText | string | Wordswhat that answer says |
| 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 |
| 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:
submit
A newsletter section, for article, journal pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, motion, reka-ui, tailwind-merge.
More newsletter blocks
- Signup popup picture top: A narrow centred card whose top half is the picture, the words and the field centred under it: a strong product picture; the merchant's own offer only.
- Signup popup side sheet: A full-height sheet at the right edge, the words and the field at the top and the picture filling the bottom: a less blocking welcome on desktop; the merchant's own offer 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.
- Strip: a tight row for the footer zone or between two sections: the promise left, the field right.
- Waitlist full split: a pre-launch page with one strong picture: the section cut in two at full height, the form on one half and the first picture filling the other edge to edge — the merchant’s own only.
- Waitlist hero: a pre-launch page in one gesture: a headline, one field, a few pictures floating at the edges — the merchant’s own only.
- Waitlist split wall: the product has pictures worth showing: the form beside a staggered wall of them — the merchant’s own only.