Call to action
A closing call-to-action panel with a headline, a short text and two buttons.
Installation
bash
npx bootcn add call-to-actionbash
pnpm dlx bootcn add call-to-actionbash
yarn dlx bootcn add call-to-actionbash
bunx --bun bootcn add call-to-actionThe CLI also installs the design tokens and these blocks and components: button. It prints the <link> and <script> tags to add to your layout.
Usage
Place it near the end of a landing page, before the footer. Keep the text short and the first button for the action you want most.
Accessibility
- The section is named by its
<h2>. - The grid pattern is decorative; text keeps 4.5:1 contrast on the muted background in both themes.
Dependencies
- Bootstrap 5.3+ CSS.
themes/tokens/tokens.css.- The
buttoncomponent.
Source
The exact files the CLI installs (call-to-action@1.0.0). View on GitHub · Report an issue
html
<section class="bootcn-cta" aria-labelledby="bootcn-cta-title">
<div class="bootcn-cta__panel">
<h2 class="bootcn-cta__title" id="bootcn-cta-title">Ready to build something people love?</h2>
<p class="bootcn-cta__text">
Join thousands of teams who launch faster with Acme. Free for your first project.
</p>
<div class="bootcn-cta__actions">
<a class="btn bootcn-button bootcn-button--default bootcn-button--lg" href="#sign-up">
Get started
</a>
<a class="btn bootcn-button bootcn-button--outline bootcn-button--lg" href="#contact">
Talk to us
</a>
</div>
</div>
</section>css
.bootcn-cta {
padding: 4rem 0;
}
.bootcn-cta__panel {
position: relative;
isolation: isolate;
overflow: hidden;
padding: 3rem 1.5rem;
border: var(--bootcn-border-width) solid var(--bootcn-border-color);
border-radius: var(--bootcn-radius-xl);
background-color: var(--bootcn-muted);
text-align: center;
}
/* Subtle grid lines behind the content. */
.bootcn-cta__panel::before {
content: '';
position: absolute;
z-index: -1;
inset: 0;
background-image:
linear-gradient(var(--bootcn-border-color) 1px, transparent 1px),
linear-gradient(90deg, var(--bootcn-border-color) 1px, transparent 1px);
background-size: 2rem 2rem;
opacity: 0.6;
-webkit-mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%);
mask-image: radial-gradient(ellipse at center, #000 20%, transparent 70%);
}
.bootcn-cta__title {
max-width: 36rem;
margin: 0 auto;
font-size: 1.875rem;
font-weight: 700;
line-height: 1.2;
letter-spacing: -0.025em;
}
.bootcn-cta__text {
max-width: 32rem;
margin: 1rem auto 0;
color: var(--bootcn-muted-foreground);
font-size: 1.125rem;
}
.bootcn-cta__actions {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 0.75rem;
margin-top: 2rem;
}
