Newsletter Section

Newsletter signup section with an email field, light validation and a submit button that steps through idle, loading, success and error from your onSubscribe promise, a form that morphs into a confirmation with a draw-in check, a privacy note, optional reader avatars for social proof, and card or inline layouts.

Preview

Newsletter Section preview width

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @karaui/newsletter-section
@karaui not found? Add it to components.json
{
  "registries": {
    "@karaui": "https://karaui.kamisama-v0.my.id/r/{name}.json"
  }
}

@karaui is in shadcn's public registry directory, so the latest CLI needs no setup. On an older CLI, merge this into the existing file once and every @karaui/… install resolves.

API Reference

variant?
"inline" | "card"

"card" is a centered bordered panel; "inline" puts copy and form side by side.

card
eyebrow?
ReactNode
—
heading?
ReactNode
Get the weekly digest
description?
ReactNode
One short email every Friday with new components, motion notes and the occasional deep dive.
placeholder?
string
you@example.com
buttonLabel?
string
Subscribe
onSubscribe?
((email: string) => void | Promise<void>)

Resolve to confirm; reject (or throw) to show the error state.

—
privacyNote?
ReactNode

Small print under the form. Pass null to hide.

No spam. Unsubscribe with one click.
socialProof?
NewsletterSocialProof
—
successTitle?
ReactNode
You're on the list
successMessage?
ReactNode | ((email: string) => ReactNode)

Receives the subscribed address.

(email: string) => ( <> We sent a confirmation to <span className="font-medium text-foreground">{email}</span>. </> )
invalidEmailMessage?
string
Enter a valid email address.
errorMessage?
string
Something went wrong. Please try again.
className?
string
—

Keep in mind

Some components on this site are inspired by or recreated from existing work across the web. I'm not here to take credit; just to learn, experiment, and sometimes push things a bit further. If something looks familiar and I forgot to mention you, reach out and I'll fix that right away.

Updated