Cta Band
A closing CTA section with a large lit headline and an inline email form whose button animates from idle to sending to a success check. Async onSubmit.
Installation
npx shadcn@latest add @minidev/cta-band
MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/cta-band.json
Usage
import { CtaBand } from "@/components/ui/cta-band"
export function Example() {
return (
<CtaBand />
)
}
API reference
| Prop | Type | Default |
|---|---|---|
| titleHeadline (rendered as h2). Wrap a phrase in `<span className="text-lit">` to make it catch the light. | React.ReactNode | ( <> Know what changed <br /> <span c... |
| descriptionOne or two sentences under the headline. | React.ReactNode | "Connect a source and get your first ... |
| placeholderEmail input placeholder. | string | "you@company.com" |
| buttonSubmit button label at rest. | string | "Start free" |
| successButton label after a successful submit. | string | "Check your inbox" |
| onSubmitCalled with the email on submit. Return a promise to show the busy state; throw to show the error line. | (email: string) => void | Promise<void> | - |
| noteSmall print under the form. | React.ReactNode | "No card. Cancel in one click." |
| className | string | - |
When to use
Use as the last section before the footer when the ask is "leave your email". For a plain row with one button use CtaBanner; for a premium glow panel use CtaGlow. onSubmit may return a promise: the button shows "Sending…" until it settles, "Check your inbox" on success, and an error line if it throws. Result is announced to screen readers.
Accessibility
- The input has
aria-label="Work email"andautoComplete="email"; the placeholder is not its label. - A
role="status"line announces thesuccesstext or the error message. It is visually hidden except when showing the error. - The button is disabled while sending and after success; the glow, grid and accent blur behind the panel are
aria-hidden. - Under reduced motion the button's width change and label swap happen instantly.
Frequently asked questions
How do I connect the email form to my API or a Server Action?
Pass onSubmit, which receives the email string: onSubmit={(email) => joinWaitlist(email)}. Return a promise and the button shows "Sending…" until it settles; throw (or reject) to show the error line. A fetch that returns a 4xx does not throw on its own, so check res.ok and throw.
Why does the form say "Check your inbox" when I have not wired it up?
Without onSubmit the band waits 700ms and then shows the success state, so the demo works on its own. Always pass onSubmit in production.
Can the visitor submit again after it succeeds?
No. After success the input is disabled and the button stays on the success label. Remount the component (change its key) to reset it.
Dependencies
npm
Built from