Ashish Sharma

Newsletter Signup

Forms

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>
  );
}

Dependencies

More by Ashish Sharma

View all
  • Perspective Gallery

    Perspective Gallery

    149
  • Bento Features

    Bento Features

    27
  • Animated Sidebar

    Animated Sidebar

    25
  • Otp Input

    Otp Input

    25
  • Glow Ring

    Glow Ring

    20
  • Notification Stack

    Notification Stack

    11
  • Expandable Tabs

    Expandable Tabs

    11
  • Voice Orb

    Voice Orb

    8

More in Forms

View all
  • Form

    Form

    7
  • Login 2

    Login 2

    16
  • Contact Form

    Contact Form

    33
  • Contact Card

    Contact Card

    1.1K
  • Book A Demo 1

    Book A Demo 1

    95
  • Premium Auth

    Premium Auth

    613
  • Onboarding Stepper

    Onboarding Stepper

    13
  • Authentication Card

    Authentication Card

    52

Explore more

Part of Caliper UI — browse the full library on 21st.dev.