# CTA Section (Notchset): prompt.md (v1.0.0)

- id: `cta` · version 1.0.0 · block · pro (Pro)
- category: Marketing
- build: Base UI (one set of files; its dependencies follow the build)
- install (this build): `npx shadcn@latest add @beautiful-ui-pro/cta`
- npm dependencies: none
- registry dependencies: utils, @beautiful-ui-pro/dot-field, https://beautiful-ui.dev/r/notchset-foundation.json
- docs: https://beautiful-ui.dev/components/cta
- The install command carries everything this item needs (files, CSS, tokens, npm and registry dependencies). Prefer it to copying source by hand.

The call to action at the end of a page in three layouts: centered over a live Dot Field, split beside a quickstart terminal whose commands copy and reveal their output, and an announcement banner that collapses when dismissed; START FREE becomes a work-email field in place and TALK TO SALES unrolls call slots to book.

## Build it
- Stack: React 19 (`ref` is a plain prop), TypeScript, Tailwind CSS v4 utilities, a shadcn-initialised project with the `@/*` alias.
- Packages: none beyond React.
- Files: `components/ui/notchset/blocks/cta.tsx`; shared code: `lib/beautiful-ui/notchset/instrument.tsx`, `lib/beautiful-ui/notchset/root.ts`.
- Registry dependencies, installed with it automatically: shadcn `utils` (cn), `dot-field`, `notchset-foundation`.
- Builds: one set of files for both, but its dependencies come in Base UI and Radix builds. Install the one that matches the project (see Install): a free item's bare URL installs the Base UI build of it and its dependencies.
- Exports to keep: `Cta`, and every exported type.
- CSS: the install adds the notchset foundation (tokens, keyframes, motion levels) to your global stylesheet once. Nothing to import by hand.
- Re-running `add` (or `--overwrite`) re-applies those rules: put overrides in your own CSS, never in the installed rules.
- Tokens: retheme with the `--notchset-*` custom properties (`--notchset-check`, `--notchset-control-edge`, `--notchset-draw-from`, `--notchset-ease-bloom`, `--notchset-ease-glide`, `--notchset-ease-key-down`, `--notchset-ease-key-up`, `--notchset-ease-travel`, `--notchset-fade`, `--notchset-focus-color`, `--notchset-focus-inset`, `--notchset-grow-to`, `--notchset-key-down`, `--notchset-key-up`, `--notchset-life-from`, `--notchset-life-ms`, `--notchset-node-blink`, `--notchset-node-bloom`, `--notchset-node-delay`, `--notchset-plate-color`, `--notchset-rise-from`, `--notchset-rule`, `--notchset-scan-to`, `--notchset-scroll`, `--notchset-signal`, `--notchset-sweep-to`, `--notchset-travel`). Never add Tailwind colour classes inside the component.

```tsx
import { Cta } from "@/components/ui/notchset/blocks/cta";
```

## Parts

| Part | data-slot | What it is for |
|---|---|---|
| `Cta` | `cta` | The section in one of three layouts. |

Style a part with `[data-slot="<slot>"]` selectors or its `className`; keep the attributes when editing.

## Sound
- Keep every `data-slot` and `data-sound` attribute: the sound layer reads them.
- Installing this item adds no audio. Nothing plays until the app mounts `SoundProvider` once (install: `npx shadcn@latest add https://beautiful-ui.dev/r/notchset-sound.json`, import from `@/components/ui/notchset/sound-provider`); `useSound()` gives `muted` and `setMuted` for a mute control. Without a provider the audio engine never loads.

## Match the original
- Read `components/ui/notchset/blocks/cta.tsx` as the reference implementation before changing or recreating anything, and match it: sizes, colours per theme, motion timings, copy and behaviour.
- If you deviate (a prop you can't honour, a style you changed, a dependency you swapped), say so in your reply, part by part.
- Keep the accessibility contract, the keyboard map and the motion levels listed below.

## Use it when
- cta, call to action, signup section, get started, talk to sales, book a demo, announcement bar, banner, quickstart, Notchset
- The last section of a landing page
- An announcement worth a bar across the top of the site

### Not when
- The hero at the top: lead with your product, not a form
- Pricing decisions: use a pricing block

## Mistakes
- Resolve onSubmit only once the workspace or link really exists
- Persist the banner's dismissal, or it returns on every page

## Usage

```tsx
import { Cta } from "@/components/ui/notchset/blocks/cta";

export function GetStarted() {
  return (
    <Cta
      title="Trace your first agent run in five minutes"
      body="Install the SDK, wrap your agent, and every step shows up. Free for 14 days, no card needed."
      signup={{
        label: "START FREE",
        submitLabel: "CREATE WORKSPACE",
        onSubmit: async (email) => {
          const res = await fetch("/api/signup", { method: "POST", body: JSON.stringify({ email }) });
          if (!res.ok) throw new Error("signup failed");
          return `Sign-in link sent to ${email}`;
        },
      }}
    />
  );
}
```

## Props

| Prop | Type | Default | What it does |
|---|---|---|---|
| `variant` | `"centered" \| "split" \| "banner"` |  | Centered over the Dot Field, split with a terminal, or the banner. |
| `live` | `{ value, label }` |  | A rolling number above the headline (update it at most once a second). |
| `title / body` | `ReactNode` |  | The headline and its line. |
| `signup` | `{ label, submitLabel, placeholder?, workingLabel?, onSubmit(email) => Promise<string> }` |  | START FREE; resolve with the line to show, reject to show the failure. |
| `sales` | `{ label, heading, slots, onBook(slot) => Promise, booked(slot) => string }` |  | TALK TO SALES and its call slots. |
| `terminal` | `{ title, commands: { command, output }[] }` |  | Split only: copying a command reveals its output and counts it done. |
| `tag / message / detail / link / action / onDismiss` | `banner` |  | The banner's content; onDismiss runs after it collapses (persist it). |

Full docs: https://beautiful-ui.dev/components/cta

## Customising
- Colours: the component reads your shadcn tokens (`--background`, `--foreground`, `--border` …), refined by the `--notchset-*` tokens. The signal colour is `--notchset-signal` (it falls back to `--destructive`). Set tokens on `:root`, or on any container to retheme one area.
- Dark mode follows the `.dark` class on an ancestor (the shadcn and next-themes convention).
- Update later by re-running the install with `--overwrite` (review the diff if you edited it). Changelog: https://beautiful-ui.dev/r/changelog.json

## Keyboard

| Keys | Action |
|---|---|
| Enter | Submit the email |
| Esc | Back from the email form to START FREE |
| Tab | Actions, slots, terminal copy buttons in order |

## Performance

- The Dot Field idles when nothing moves and pauses off screen; everything else is CSS transitions.

## Responsive

- Split stacks the terminal under the copy under 760px (container width); the banner wraps.

## Motion inventory

| Interaction | What moves |
|---|---|
| START FREE | The buttons lift away and the form rises (200ms glide); the arrow nudges on hover |
| Sending | The 5-tick scanner, then the confirmation |
| TALK TO SALES | Slots unroll (360ms unfold) and fold away (200ms) |
| Terminal | A copied command's output unrolls; the count rolls |
| Banner | Dismissing collapses the bar (200ms) |

## Accessibility contract (preserve when editing)
- The section's headline is an h2; the banner is a named region
- Only the visible state (buttons, form or confirmation) is reachable; the others are inert
- Messages, the confirmation and booking results are announced (aria-live, role=status); call slots are a radio group
- The background field is decorative; the banner's dismiss button is named

## Install

```bash
npx shadcn@latest add @beautiful-ui-pro/cta
```

Pro item: needs the `@beautiful-ui-pro` registry in `components.json` and `BEAUTIFUL_UI_TOKEN` in `.env.local` (https://beautiful-ui.dev/account). Setup: https://beautiful-ui.dev/docs/pro. Your components.json `style` picks the build: radix-*, new-york and default get Radix, base-* gets Base UI.

## Credits
- Built on shadcn/ui (https://ui.shadcn.com)

The notchset foundation (the tokens listed above, keyframes and motion levels) installs once with the first component; its CSS is public at https://beautiful-ui.dev/r/notchset-foundation.json.
