Xzero UI
Pro library

CTA section

A call to action as a centered closing section, a split beside a setup card that completes itself, or a dismissible banner.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui/cta-section
Live · keyboard ready

Use this to ask for a trial, demo or signup. Pass href or onClick to each action; edit sample copy in cta-section-data.ts. Buttons in the preview confirm in place.

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui/cta-section

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { CtaSection } from "@/components/xzero/blocks/cta-section/cta-section";

export function Closing() {
  return (
    <CtaSection
      variant="split"
      title="Your team, set up before lunch"
      primaryAction={{ label: "Create a workspace", href: "/signup" }}
      secondaryAction={{ label: "Book a demo", href: "/demo" }}
      points={["Import from any tracker", "SSO included", "Cancel anytime"]}
    />
  );
}

API reference

CtaSection

A call to action in three shapes chosen by variant: a centered closing section, a split layout beside a product visual, and a compact dismissible banner.

PropTypeDefaultDescription
variant"centered" | "split" | "banner""centered"centered closes a page, split sits beside a setup card that completes itself, banner is one line with an action.
titlestring–Heading. Each variant has sample copy.
descriptionstring–One sentence under the heading.
primaryActionCtaAction–{ label, href?, onClick?, confirmedLabel? }. With href it renders a link; with neither href nor onClick it confirms in place.
secondaryActionCtaAction | null–Second action in centered and split. Pass null to hide it.
notestring"No credit card required"Small print under the actions in centered.
facesstring[]–Up to four avatar URLs beside the note in centered. Pass [] to hide them.
pointsstring[]–Benefit lines with checks in split.
visualReactNode–Replaces the split variant's setup card, for your own screenshot or component.
onDismiss() => void–Banner only. Shows the dismiss button and is called after the banner has closed.
classNamestring–Extra class on the section.

Keyboard interactions

KeysAction
TabMoves through the actions, then the dismiss button in the banner.
Enter or SpaceRuns an action or dismisses the banner.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Guidance for AI tools

Blocks are complete, self-contained screens with sample data. Replace the sample data and connect the callbacks described above. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components