About
An email signup form with inline validation, a loading button and a success confirmation message, for collecting newsletter subscribers.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Newsletter Signup to your project and fits it to your theme.
Code
How Newsletter Signup is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
import NewsletterSignup from "@/components/ui/newsletter-signup";
const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
export default function NewsletterSignupDemo() {
return (
<div className="flex min-h-[420px] w-full items-center justify-center bg-background p-6">
<NewsletterSignup
className="rounded-overlay border border-border bg-surface p-6 shadow-resting sm:px-8"
note="One email a month when new parts ship. We never share your address."
onSubmit={async (email) => {
await wait(900);
if (/fail/i.test(email))
throw new Error(
"We couldn't add you right now. Try again in a moment.",
);
}}
/>
</div>
);
}
















