Newsletter
Shown as Dispatch, a made-up product
A freight platform's weekly brief beside the issue itself: four recent issues as tabs, a trend that draws in, a signup that catches typos and offers a team plan, and an issue that's addressed to you once you subscribe.
Installation
pnpm dlx shadcn@latest add "https://propui.dev/r/dispatch-newsletter.json?token=…"Adds the piece to components/propui/09-dispatch-newsletter/ and installs motion. Needs a free account: sign in and the command includes your token. Fonts load from Prop UI; download the zip to self-host them.
When to use
Reach for it when
- A newsletter or research brief signup where showing the issue itself is the best argument to subscribe.
- A B2B newsletter that should offer a team subscription when someone signs up with a work address.
- A signup form that needs real states: validation, a typo catch, sending, failure and success.
Something else fits when
- A one-line footer signup: a single field and button is lighter.
- A full archive of past issues: link to an archive page instead of adding more tabs.
- Product release notes: Release notes is built for releases.
Usage
A section in normal page flow.
import Piece from "@/components/propui/09-dispatch-newsletter/Section";
export default function Page() {
return <Piece />;
}Replace brief, sheets, current and faces in data.ts with your newsletter, and the timeout in submit() in Brief.tsx with your subscribe call. The reader count, issue tabs, sheet and footer are all read from data.ts.
Your data
Replace these and everything on screen follows.
brief{ product; name; cadence; minutes; author; readers; teams; openRate }- The kicker, the facts list, the proof line and the sheet footer.
sheets{ number; week; date; title; minutes; stat; measure; series; unit; finding; contents }[]- One tab and sheet per issue; series is twelve weekly values for the trend.
currentBriefIssue & { finding; stat; contents }- This week's issue: the next issue number after subscribing and the archive count.
faces{ initials; fill }[]- The reader initials beside the proof line.
domainSlips, freeMailRecord<string, string>, Set<string>- Typo suggestions for email domains, and the free-mail domains that never get the team offer.
Interactions
- Pick an issue tab to see its sheet: the finding, the week's figure with a 12-week trend that draws in, and what's inside.
- Type a work email: leaving the field checks it, and a work domain offers to send the brief to everyone there.
- Mistype a common domain (gmial.com) to get a one-click fix.
- Subscribe: the button shows Subscribing, then Subscribed; the reader count ticks up and the sheet is addressed to you.
- Turn on Preview: fail the next send to see the failure state, which keeps the email for a retry.
- Use a different email to start again.
Keyboard
- Tab
- Move through the issue tabs, the form and the switch.
- Enter
- In the email field, subscribe.
- EnterorSpace
- Open the focused issue, tick the team offer or flip the preview switch.
Behaviour
Read from the code: roles, motion, breakpoints and what runs.
Accessibility
- Issues are a tablist with aria-selected and one tabpanel labelled by the chosen tab.
- The email field has a label; an invalid address sets aria-invalid, and the message is tied to the field with aria-describedby and read out as an alert.
- The message line is a polite live region, so the typo suggestion and the confirmation are announced.
- While sending, the button is aria-busy; after subscribing it is aria-disabled and leaves the tab order.
- The preview control is a button with role switch and aria-checked; the trend chart is decorative and its values are in the text.
Motion
- The issue pill glides between tabs on a spring; sheets cross-fade with a short rise.
- The trend line draws in and its fill fades up each time a sheet opens.
- Button labels and the message line swap in place, rising out of a soft blur; the field shakes once on an invalid address or a failed send.
- The reader count ticks up by one after subscribing.
- Reduced motion swaps text with a plain fade, shows the trend already drawn and drops the shake.
Responsive
- At 960px and below the issue moves under the signup in one column.
- At 560px and below the nav links hide, the button sits under the field at full width, the tabs become a 2 × 2 grid and the sheet's figure stacks above its trend.
Performance
- Every label is laid out once in a hidden sizer, so the button never changes width between states.
- No images: the trend is one inline SVG path and the page uses one local font file.
Notes for AI
Give your coding assistant the Markdown, not a screenshot.
- Keep every figure in data.ts; a sheet's stat, finding and series describe the same twelve weeks, so change them together.
- Replace the simulated send in submit() with your API call, and keep the failed state keeping the email.
- Every class is prefixed dp- and scoped under .dp; keep colours in the tokens at the top of post.css.
/p/dispatch-newsletter/markdownThe whole library for assistants: llms.txt, or the MCP server in AI tools and MCP.