Prodular UI

Newsletter signup

An email signup as its own band: the pitch on one side and the field on the other, with sending, done and error states.

npx prodular-ui add newsletter-signup

Default

Enter any address to see the done state.

Get the changelog by email

One email every two weeks with what shipped. Nothing else.

Unsubscribe with one click.

Error

onSubscribe throws, so the message shows under the field.

Product updates

Try any valid address: this one always fails, to show the error.

Anatomy

<Section size="sm">  <NewsletterSignup title="Product updates" onSubscribe={subscribe} /></Section>

Guidance

Use it when

  • At the end of a changelog or blog, where people already want more.
  • note to say how often you send.

Avoid

  • A second signup on the same page as the footer newsletter.
  • Promising content you do not send.

Rules for AI agents

Published in llms-full.txt, the registry and the MCP server, so coding agents follow them when they build with this component.

  • Throw an Error with a readable message from onSubscribe; it is shown as is.
  • Put it in a Section with size sm.

API

NewsletterSignup

PropTypeDefaultDescription
onSubscribe(email: string) => Promise<void> | voidSubscribes the address. Throw to show the error.
title / lead / noteReactNodeThe pitch and the line under the field.
actionstring"Subscribe"The button text.

Installation

The Prodular UI CLI adds the source to components/ui with everything it depends on. In a project that already uses shadcn/ui, the shadcn CLI installs it from the Prodular registry too. See Installation for the first setup.

npx prodular-ui add newsletter-signup# or, with the registry in components.jsonnpx shadcn@latest add @prodular/newsletter-signup

Used in these screens