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-sectionInstallation
With the shadcn CLI
npx shadcn@latest add @silicon-ui/cta-sectionManually
Install the dependencies
npm install lucide-react motionCopy 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
Add the foundation, once per app, for the design and motion tokens
npx shadcn@latest add @silicon-ui/silicon-foundation
Usage
API reference
CtaSection
| Prop | Type | Default |
|---|---|---|
variant`centered` is a closing section, `split` sits beside a product visual, `banner` is one dismissible line. | CtaVariant
| "centered" |
title | string | — |
description | string | — |
primaryAction | CtaAction | — |
secondaryActionNot shown in the banner variant. Pass null to hide it. | CtaAction | null | — |
noteSmall print under the actions in the centered variant, such as "No credit card required". | string | — |
facesFaces beside the note in the centered variant. Pass an empty array to hide them. | string[] | ctaFaces |
pointsShort benefit lines in the split variant. | string[] | — |
visualReplaces the split variant's setup card. | ReactNode | — |
onDismissBanner only: shows a dismiss button and calls this after it closes. | () => void | — |
className | string | — |
Also accepts the props of HTMLAttributes.