Skip to content

CTA section

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

npx shadcn@latest add @silicon-ui/cta-section

Installation

With the shadcn CLI

npx shadcn@latest add @silicon-ui/cta-section

Manually

  1. Install the dependencies

    npm install lucide-react motion
  2. Copy these files into your project

    • components/silicon-ui/blocks/cta-section/cta-section.tsx
    • components/silicon-ui/blocks/cta-section/cta-section-data.ts
    • components/silicon-ui/blocks/cta-section/cta-section.module.css

    Shared with other components. Skip any you already have.

    • components/silicon-ui/lib/media.ts
    • components/silicon-ui/segmented-control/segmented-control.tsx
    • components/silicon-ui/segmented-control/segmented-control.module.css
    • components/silicon-ui/button/button.tsx
    • components/silicon-ui/button/button.module.css
    • components/silicon-ui/lib/fluid-hover.tsx
  3. Add the foundation, once per app, for the design and motion tokens

    npx shadcn@latest add @silicon-ui/silicon-foundation

Usage

usage.tsx
import { CtaSection } from "@/components/silicon-ui/blocks/cta-section/cta-section";

API reference

CtaSection

PropTypeDefault
variant

`centered` is a closing section, `split` sits beside a product visual, `banner` is one dismissible line.

CtaVariant

"banner""split""centered"

"centered"
titlestring—
descriptionstring—
primaryActionCtaAction—
secondaryAction

Not shown in the banner variant. Pass null to hide it.

CtaAction | null—
note

Small print under the actions in the centered variant, such as "No credit card required".

string—
faces

Faces beside the note in the centered variant. Pass an empty array to hide them.

string[]ctaFaces
points

Short benefit lines in the split variant.

string[]—
visual

Replaces the split variant's setup card.

ReactNode—
onDismiss

Banner only: shows a dismiss button and calls this after it closes.

() => void—
classNamestring—

Also accepts the props of HTMLAttributes.

Dependencies

npm
lucide-reactmotion
Registry
silicon-motion-tokensbuttonsegmented-control