CTA banner
A closing call to action: one panel in your accent colour that breaks into dots towards the bottom, with a headline, one line, a raised white button and a quieter second one.
Ready when you are
Start free for 14 days. No card needed, and you can leave whenever you like.
14 days free No card Cancel in two clicks
Options
Code
import "./cta-banner.css";
/* <CtaBanner title="Ready when you are" text="Start free for 14 days." action="Start free" href="/sign-up" other="Talk to us" otherHref="/contact" notes={["14 days free", "No card"]} /> */
export function CtaBanner({ title, text, action, href = "#", other, otherHref = "#", notes = [] }) {
return (
<section className="dh-cta">
<div className="dh-cta-panel">
<div className="dh-cta-fill" aria-hidden="true" />
<div className="dh-cta-text">
<h2>{title}</h2>
<p>{text}</p>
</div>
<div className="dh-cta-actions">
<a className="dh-cta-main" href={href}>
{action}
<svg viewBox="0 0 16 16" aria-hidden="true">
<path d="M3.5 8h9M8.5 4l4 4-4 4" />
</svg>
</a>
{other && (
<a className="dh-cta-other" href={otherHref}>
{other}
</a>
)}
</div>
{notes.length > 0 && (
<p className="dh-cta-note">
{notes.map((note, index) => [index > 0 && <i key={"dot" + index} />, " ", note, " "])}
</p>
)}
</div>
</section>
);
}
export function Example() {
return (
<CtaBanner
title="Ready when you are"
text="Start free for 14 days. No card needed, and you can leave whenever you like."
action="Start free"
other="Talk to us"
notes={["14 days free", "No card", "Cancel in two clicks"]}
/>
);
}/* A closing call to action. One panel in your accent colour that is solid at
the top and breaks into dots towards the bottom, with a headline, one line,
a raised white button and a quieter second one. */
.dh-cta {
container: dh-cta / inline-size;
padding: 24px;
background: var(--dh-bg, #f7f7f6);
font-family: inherit;
}
.dh-cta *,
.dh-cta *::before,
.dh-cta *::after {
box-sizing: border-box;
}
.dh-cta-panel {
--accent: var(--dh-accent, #2563ff);
--on: var(--dh-on-accent, #fff);
--ease: cubic-bezier(0.23, 1, 0.32, 1);
--fade: 112px;
position: relative;
display: grid;
grid-template-columns: 1fr auto;
align-items: end;
gap: 16px 32px;
max-width: 1040px;
margin: 0 auto;
padding: 44px 48px calc(var(--fade) + 28px);
color: var(--on);
font-size: 13px;
line-height: 20px;
}
/* The fill is its own layer so the mask that breaks it into dots does not
touch the words and buttons. --fade is how tall the dotted part is. */
.dh-cta-fill {
position: absolute;
inset: 0;
border-radius: 20px 20px 0 0;
background:
radial-gradient(90% 120% at 100% 0, color-mix(in srgb, var(--accent) 70%, #fff), transparent 60%),
linear-gradient(color-mix(in srgb, var(--accent) 78%, #000), var(--accent));
-webkit-mask-image: linear-gradient(to top, transparent 10px, #000 var(--fade)), radial-gradient(circle, #000 1.6px, transparent 2px);
mask-image: linear-gradient(to top, transparent 10px, #000 var(--fade)), radial-gradient(circle, #000 1.6px, transparent 2px);
-webkit-mask-size: auto, 6px 6px;
mask-size: auto, 6px 6px;
animation: dh-cta-fill 0.9s var(--ease) both;
}
.dh-cta-panel > :not(.dh-cta-fill) {
position: relative;
animation: dh-cta-in 0.6s var(--ease) 0.1s both;
}
.dh-cta-text {
max-width: 460px;
}
.dh-cta h2 {
margin: 0;
font-size: 32px;
font-weight: 500;
line-height: 40px;
letter-spacing: -0.03em;
}
.dh-cta-text p {
margin: 8px 0 0;
color: color-mix(in srgb, var(--on) 82%, transparent);
font-size: 15px;
line-height: 24px;
}
.dh-cta-actions {
display: flex;
gap: 8px;
animation-delay: 0.18s !important;
}
.dh-cta-actions a {
display: inline-flex;
align-items: center;
gap: 6px;
height: 36px;
padding: 0 14px;
border-radius: 9px;
font-weight: 500;
letter-spacing: -0.01em;
text-decoration: none;
white-space: nowrap;
transition:
transform 150ms var(--ease),
background-color 150ms var(--ease);
}
/* The main button is raised white, so it stands off the accent. */
.dh-cta-main {
padding-right: 11px !important;
background: linear-gradient(#fff, color-mix(in srgb, var(--accent) 7%, #fff));
box-shadow:
inset 0 1px 0 #fff,
0 0 0 1px color-mix(in srgb, var(--accent) 60%, #000),
0 1px 2px rgb(0 0 0 / 0.3),
0 8px 16px -8px rgb(0 0 0 / 0.4);
color: color-mix(in srgb, var(--accent) 60%, #0b0c0f);
}
.dh-cta-main svg {
width: 14px;
height: 14px;
fill: none;
stroke: currentColor;
stroke-width: 1.6;
stroke-linecap: round;
stroke-linejoin: round;
transition: translate 0.3s var(--ease);
}
.dh-cta-other {
background: color-mix(in srgb, var(--on) 14%, transparent);
box-shadow:
inset 0 1px 0 color-mix(in srgb, var(--on) 22%, transparent),
0 0 0 1px color-mix(in srgb, var(--accent) 70%, #000);
color: var(--on);
}
.dh-cta-actions a:active {
transform: scale(0.97);
}
.dh-cta-actions a:focus-visible {
outline: 2px solid var(--on);
outline-offset: 2px;
}
/* A quiet line of small print, set in a fixed-width face. */
.dh-cta-note {
grid-column: 1 / -1;
display: flex;
align-items: center;
gap: 10px;
margin: 12px 0 0;
color: color-mix(in srgb, var(--on) 70%, transparent);
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 11px;
line-height: 16px;
animation-delay: 0.24s !important;
}
.dh-cta-note i {
width: 3px;
height: 3px;
border-radius: 50%;
background: currentColor;
}
@media (hover: hover) and (pointer: fine) {
.dh-cta-main:hover svg {
translate: 2px 0;
}
.dh-cta-other:hover {
background: color-mix(in srgb, var(--on) 22%, transparent);
}
}
@container dh-cta (max-width: 720px) {
.dh-cta {
padding: 12px;
}
.dh-cta-panel {
grid-template-columns: 1fr;
min-height: 0;
--fade: 96px;
padding: 28px 24px calc(var(--fade) + 24px);
}
.dh-cta-fill {
border-radius: 16px 16px 0 0;
}
.dh-cta h2 {
font-size: 26px;
line-height: 32px;
}
.dh-cta-actions {
flex-direction: column;
margin-top: 8px;
}
.dh-cta-actions a {
justify-content: center;
height: 44px;
font-size: 15px;
}
.dh-cta-note {
flex-wrap: wrap;
gap: 4px 10px;
}
}
@keyframes dh-cta-fill {
from {
opacity: 0;
}
}
@keyframes dh-cta-in {
from {
opacity: 0;
filter: blur(6px);
transform: translateY(8px);
}
}
@media (prefers-reduced-motion: reduce) {
.dh-cta-fill,
.dh-cta-panel > :not(.dh-cta-fill) {
animation: none;
}
.dh-cta-actions a,
.dh-cta-main svg {
transition: none;
}
}<section class="dh-cta">
<div class="dh-cta-panel">
<div class="dh-cta-fill" aria-hidden="true"></div>
<div class="dh-cta-text">
<h2>Ready when you are</h2>
<p>Start free for 14 days. No card needed, and you can leave whenever you like.</p>
</div>
<div class="dh-cta-actions">
<a class="dh-cta-main" href="#">
Start free
<svg viewBox="0 0 16 16" aria-hidden="true"><path d="M3.5 8h9M8.5 4l4 4-4 4" /></svg>
</a>
<a class="dh-cta-other" href="#">Talk to us</a>
</div>
<p class="dh-cta-note">14 days free <i></i> No card <i></i> Cancel in two clicks</p>
</div>
</section>/* A closing call to action. One panel in your accent colour that is solid at
the top and breaks into dots towards the bottom, with a headline, one line,
a raised white button and a quieter second one. */
.dh-cta {
container: dh-cta / inline-size;
padding: 24px;
background: var(--dh-bg, #f7f7f6);
font-family: inherit;
}
.dh-cta *,
.dh-cta *::before,
.dh-cta *::after {
box-sizing: border-box;
}
.dh-cta-panel {
--accent: var(--dh-accent, #2563ff);
--on: var(--dh-on-accent, #fff);
--ease: cubic-bezier(0.23, 1, 0.32, 1);
--fade: 112px;
position: relative;
display: grid;
grid-template-columns: 1fr auto;
align-items: end;
gap: 16px 32px;
max-width: 1040px;
margin: 0 auto;
padding: 44px 48px calc(var(--fade) + 28px);
color: var(--on);
font-size: 13px;
line-height: 20px;
}
/* The fill is its own layer so the mask that breaks it into dots does not
touch the words and buttons. --fade is how tall the dotted part is. */
.dh-cta-fill {
position: absolute;
inset: 0;
border-radius: 20px 20px 0 0;
background:
radial-gradient(90% 120% at 100% 0, color-mix(in srgb, var(--accent) 70%, #fff), transparent 60%),
linear-gradient(color-mix(in srgb, var(--accent) 78%, #000), var(--accent));
-webkit-mask-image: linear-gradient(to top, transparent 10px, #000 var(--fade)), radial-gradient(circle, #000 1.6px, transparent 2px);
mask-image: linear-gradient(to top, transparent 10px, #000 var(--fade)), radial-gradient(circle, #000 1.6px, transparent 2px);
-webkit-mask-size: auto, 6px 6px;
mask-size: auto, 6px 6px;
animation: dh-cta-fill 0.9s var(--ease) both;
}
.dh-cta-panel > :not(.dh-cta-fill) {
position: relative;
animation: dh-cta-in 0.6s var(--ease) 0.1s both;
}
.dh-cta-text {
max-width: 460px;
}
.dh-cta h2 {
margin: 0;
font-size: 32px;
font-weight: 500;
line-height: 40px;
letter-spacing: -0.03em;
}
.dh-cta-text p {
margin: 8px 0 0;
color: color-mix(in srgb, var(--on) 82%, transparent);
font-size: 15px;
line-height: 24px;
}
.dh-cta-actions {
display: flex;
gap: 8px;
animation-delay: 0.18s !important;
}
.dh-cta-actions a {
display: inline-flex;
align-items: center;
gap: 6px;
height: 36px;
padding: 0 14px;
border-radius: 9px;
font-weight: 500;
letter-spacing: -0.01em;
text-decoration: none;
white-space: nowrap;
transition:
transform 150ms var(--ease),
background-color 150ms var(--ease);
}
/* The main button is raised white, so it stands off the accent. */
.dh-cta-main {
padding-right: 11px !important;
background: linear-gradient(#fff, color-mix(in srgb, var(--accent) 7%, #fff));
box-shadow:
inset 0 1px 0 #fff,
0 0 0 1px color-mix(in srgb, var(--accent) 60%, #000),
0 1px 2px rgb(0 0 0 / 0.3),
0 8px 16px -8px rgb(0 0 0 / 0.4);
color: color-mix(in srgb, var(--accent) 60%, #0b0c0f);
}
.dh-cta-main svg {
width: 14px;
height: 14px;
fill: none;
stroke: currentColor;
stroke-width: 1.6;
stroke-linecap: round;
stroke-linejoin: round;
transition: translate 0.3s var(--ease);
}
.dh-cta-other {
background: color-mix(in srgb, var(--on) 14%, transparent);
box-shadow:
inset 0 1px 0 color-mix(in srgb, var(--on) 22%, transparent),
0 0 0 1px color-mix(in srgb, var(--accent) 70%, #000);
color: var(--on);
}
.dh-cta-actions a:active {
transform: scale(0.97);
}
.dh-cta-actions a:focus-visible {
outline: 2px solid var(--on);
outline-offset: 2px;
}
/* A quiet line of small print, set in a fixed-width face. */
.dh-cta-note {
grid-column: 1 / -1;
display: flex;
align-items: center;
gap: 10px;
margin: 12px 0 0;
color: color-mix(in srgb, var(--on) 70%, transparent);
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 11px;
line-height: 16px;
animation-delay: 0.24s !important;
}
.dh-cta-note i {
width: 3px;
height: 3px;
border-radius: 50%;
background: currentColor;
}
@media (hover: hover) and (pointer: fine) {
.dh-cta-main:hover svg {
translate: 2px 0;
}
.dh-cta-other:hover {
background: color-mix(in srgb, var(--on) 22%, transparent);
}
}
@container dh-cta (max-width: 720px) {
.dh-cta {
padding: 12px;
}
.dh-cta-panel {
grid-template-columns: 1fr;
min-height: 0;
--fade: 96px;
padding: 28px 24px calc(var(--fade) + 24px);
}
.dh-cta-fill {
border-radius: 16px 16px 0 0;
}
.dh-cta h2 {
font-size: 26px;
line-height: 32px;
}
.dh-cta-actions {
flex-direction: column;
margin-top: 8px;
}
.dh-cta-actions a {
justify-content: center;
height: 44px;
font-size: 15px;
}
.dh-cta-note {
flex-wrap: wrap;
gap: 4px 10px;
}
}
@keyframes dh-cta-fill {
from {
opacity: 0;
}
}
@keyframes dh-cta-in {
from {
opacity: 0;
filter: blur(6px);
transform: translateY(8px);
}
}
@media (prefers-reduced-motion: reduce) {
.dh-cta-fill,
.dh-cta-panel > :not(.dh-cta-fill) {
animation: none;
}
.dh-cta-actions a,
.dh-cta-main svg {
transition: none;
}
}CTA banner is not in the Figma file yet.
Use the React or HTML code for now.