# 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.

- Kind: Block (Landing pages)
- Docs: https://ui.minidev.pro/docs/cta-band
- Source (registry JSON with the full file): https://ui.minidev.pro/r/cta-band.json
- License: MIT. One file, yours to edit after install.

## 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.

## Installation

### shadcn CLI (copies the source into your project)

```bash
npx shadcn@latest add @minidev/cta-band
```

Writes `components/ui/cta-band.tsx` and installs its npm dependencies. Older CLI versions: `npx shadcn@latest add https://ui.minidev.pro/r/cta-band.json`.

### npm package

```bash
npm i minidev-ui-kit lucide-react motion
```

Add the tokens to your global stylesheet once:

```css
@import "tailwindcss";
@import "minidev-ui-kit/styles.css";
@source "../node_modules/minidev-ui-kit";
```

Next.js also needs `transpilePackages: ["minidev-ui-kit"]` in next.config.

## Import

After the shadcn install:

```tsx
import { CtaBand } from "@/components/ui/cta-band"
```

From the npm package:

```tsx
import { CtaBand } from "minidev-ui-kit/blocks/cta-band"
```

## Usage

```tsx
import { CtaBand } from "@/components/ui/cta-band"

export function Example() {
  return (
    <CtaBand />
  )
}
```

## Props

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `title` | `React.ReactNode` | `( <> Know what changed <br /> <span c...` | no | Headline (rendered as h2). Wrap a phrase in `<span className="text-lit">` to make it catch the light. |
| `description` | `React.ReactNode` | `"Connect a source and get your first ...` | no | One or two sentences under the headline. |
| `placeholder` | `string` | `"you@company.com"` | no | Email input placeholder. |
| `button` | `string` | `"Start free"` | no | Submit button label at rest. |
| `success` | `string` | `"Check your inbox"` | no | Button label after a successful submit. |
| `onSubmit` | `(email: string) => void \| Promise<void>` | - | no | Called with the email on submit. Return a promise to show the busy state; throw to show the error line. |
| `note` | `React.ReactNode` | `"No card. Cancel in one click."` | no | Small print under the form. |
| `className` | `string` | - | no |  |

## Accessibility

- The input has `aria-label="Work email"` and `autoComplete="email"`; the placeholder is not its label.
- A `role="status"` line announces the `success` text 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.

## FAQ

### 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.

## Rules for generating code

- Use semantic tokens only (bg, surface, sunken, border, fg, fg-muted, fg-subtle, ink, accent, success, warning, danger). Never raw hex or palette steps like blue-500.
- Shadows only from the set: shadow-xs, shadow-sm, shadow-raised, shadow-md, shadow-lg, shadow-overlay.
- Numbers use tabular-nums. Dark mode is the `dark` class on <html>; components never branch on theme.

## Dependencies

- npm: `lucide-react`, `motion`

## Related

- [Cta Banner](https://ui.minidev.pro/docs/cta-banner/md): Tailwind call to action banner with a heading, supporting text and a primary button that stacks on mobile and sits in a row on wider screens.
- [Cta Glow](https://ui.minidev.pro/docs/cta-glow/md): A call to action card in Tailwind with soft accent glow layers, a title, optional description, a magnetic get started button and an outline button.
- [Marketing Landing](https://ui.minidev.pro/docs/marketing-landing/md): A complete Tailwind landing page assembled from a hero with two actions, a logo cloud, a stats strip, a three column feature grid and a closing CTA banner.
- [Bento Live](https://ui.minidev.pro/docs/bento-live/md): A React bento feature grid where each tile runs a live demo: a rolling MRR counter, a typed AI answer, ranked alerts and an orbiting integrations ring.
- [Changelog Page](https://ui.minidev.pro/docs/changelog-page/md): A Tailwind changelog card listing releases with a monospace version, tag badge, date, title and summary, separated by hairline dividers.
- [Faq Section](https://ui.minidev.pro/docs/faq-section/md): An FAQ section with a heading column and an accessible accordion: one answer open at a time, arrow key navigation, aria-expanded and smooth row animation.

---

All 557 components: https://ui.minidev.pro/llms.txt (full text: https://ui.minidev.pro/llms-full.txt).
