The call to action closes a page or a major section with a heading, a sentence of motivation and a group of actions, one of them primary. .forma-cta__text holds the eyebrow, h2 and sentence; an .forma-actions group follows it. On the page tone a strong rule sits above the block; with a non-page data-forma-tone the block becomes a padded panel without the rule. Actions are ordinary links or buttons: where they lead is the site's decision.
Use when
Ending a marketing or product page with the next step most readers should take.
Closing a long section with a clear action before the page continues.
The action should stand out from the page, for example on the inverse tone.
Avoid when
Opening the page: the Hero carries the first primary action.
Reporting status or asking for confirmation: use Alert or Dialog.
An inline supporting remark inside an article: use Callout.
Behavior to know
Text grows first (basis 32rem, minimum 20rem or full width); actions sit beside it when there is room and wrap below it otherwise.
Actions start at the inline start when wrapped, so they follow the text's reading edge.
Primary buttons use the tone's action colors, so they invert correctly on the inverse tone.
Basic example
The smallest correct markup: the canonical pattern from patterns/cta.html inside its public tag. Copy this first, then adapt labels, names and state.
Canonical
Minimal call to action
Rendered from the canonical pattern file.
Static specimen. Its links point to placeholder destinations that do not exist on this site. Its controls are shown for their markup and appearance and cannot be operated here.
Start here
Bring the problem that matters
One primary action per call to action; secondary actions stay visibly lower in the hierarchy.
<forma-cta class="forma-component-tag">
<div class="forma-site">
<section class="forma-section" aria-labelledby="cta-page-tone-title">
<div class="forma-cta">
<div class="forma-cta__text">
<h2 id="cta-page-tone-title">Start with a pinned Forma release</h2>
<p>Every site consumes the same versioned presentation layer.</p>
</div>
<div class="forma-actions"><a class="forma-button" data-forma-variant="primary" href="#cta-page-tone-title">Install</a><a class="forma-button" href="#cta-page-tone-title">Read the upgrade guide</a></div>
</div>
</section>
</div>
</forma-cta>
Click or tap the code once to select all of it, then copy.
Scenario
Surface panel with a single action
data-forma-tone="surface" turns the CTA into a padded panel on the secondary surface. Links and labels switch to text colors validated for that surface.
Live demo. 2 native actions work here and are verified by an outcome test.
<forma-cta class="forma-component-tag">
<div class="forma-site">
<section class="forma-section" aria-labelledby="cta-surface-single-action-title">
<div class="forma-cta" data-forma-tone="surface">
<div class="forma-cta__text">
<p class="forma-eyebrow">Research digest</p>
<h2 id="cta-surface-single-action-title">Get new papers when they are published</h2>
<p>One email per paper. No tracking. <a href="#cta-surface-single-action-title">Read past issues</a>.</p>
</div>
<div class="forma-actions"><a class="forma-button" data-forma-variant="primary" href="#cta-surface-single-action-title">Subscribe</a></div>
</div>
</section>
</div>
</forma-cta>
Click or tap the code once to select all of it, then copy.
Mobile
Each mobile example renders in its own document inside a real narrow viewport, so Forma's media and container queries run exactly as they would on a phone. Choose a width to compare.
Mobile example
Phone inverse CTA
An inverse-tone CTA at phone width. The actions wrap below the text and stack.
Live demo. 2 native actions work here and are verified by an outcome test.
Frames narrower than the selected width show the component at the width available.
What changes at narrow widths
Text needs at least 20rem (or the full width), so actions wrap below it on phones and start at the inline start.
Each button keeps a 44px minimum target; two buttons stack when they do not fit side by side.
The toned panel's padding comes from the fluid block-space token and shrinks at narrow widths.
The heading wraps and balances its lines; nothing scrolls horizontally at 320px.
<forma-cta class="forma-component-tag">
<div class="forma-site">
<section class="forma-section" aria-labelledby="cta-mobile-inverse-title">
<div class="forma-cta" data-forma-tone="inverse">
<div class="forma-cta__text">
<p class="forma-eyebrow">Start here</p>
<h2 id="cta-mobile-inverse-title">Bring the problem that matters</h2>
<p>A first conversation costs nothing and ends with a clear next step.</p>
</div>
<div class="forma-actions"><a class="forma-button" data-forma-variant="primary" href="#cta-mobile-inverse-title">Start a diagnostic</a><a class="forma-button" href="#cta-mobile-inverse-title">Meet the team</a></div>
</div>
</section>
</div>
</forma-cta>
Click or tap the code once to select all of it, then copy.
Baseline
Mobile · 320px
The canonical pattern in a true 320px viewport, the minimum width every Forma component must support without page-level horizontal scrolling.
Static specimen. Its links point to placeholder destinations that do not exist on this site. Its controls are shown for their markup and appearance and cannot be operated here.
Frames narrower than the selected width show the component at the width available.
API and configuration
Forma components have no JavaScript API. Their public contract is the markup: native elements and attributes you write, and the CSS hooks below. The CSS hook table is generated from the built stylesheet, so it always matches the shipped implementation.
Native and ARIA attributes
Attribute
On
Values
Default
Description
aria-labelledby
section
id of the CTA heading
—
Names the section that contains the CTA.
CSS hooks (derived from dist/all.css)
Hook
Kind
Values or default
Description
.forma-cta
Block class
—
Root: a wrapping flex row of text and actions, with a strong top rule on the page tone.
.forma-cta__text
Element class
—
Eyebrow, heading and sentence. Grows first with a 32rem basis and a 20rem (or 100%) minimum.
[data-forma-tone]
Attribute hook
—
surface, elevated or inverse on .forma-cta sets that surface, pads the block on all sides and removes the top rule. page or no tone keeps the rule.
Keyboard interaction
Keys
Result
Tab / Shift+Tab
Moves through any links in the text, then the actions, in source order.
Enter
Follows the focused link; a button also activates with Space.
States
Call to action states
State
How it is expressed
Presentation
Page tone
no data-forma-tone
Strong top rule on the page background.
Toned panel
data-forma-tone="surface|elevated|inverse"
Padded panel on that surface; primary action colors invert on inverse.
Wrapped
flex-wrap
Actions move below the text.
Accessibility
Forma provides
Uses contrast-validated tone pairs for text, links and both button variants on every tone.
Keeps 44px button targets and the shell's visible focus ring, which remains visible on inverse.
Borders toned panels in forced colors so they stay delineated.
Your application supplies
Use one data-forma-variant="primary" action per CTA.
Write action labels that name the outcome ("Start a diagnostic"), not "Click here".
Give the CTA a real heading at the right level.
Responsive behavior
Content-driven wrapping; no breakpoints.
The text minimum is min(100%, 20rem), so the CTA never forces horizontal overflow.
Toned panels use fluid padding.
Motion
The CTA itself does not animate. Its buttons interpolate background and text color on hover over the shared perceptual duration (about 120ms), without moving.
Under reduced motion the button color change is instant.
Usage guidance
Do
End a page with one CTA that repeats or advances the hero's primary action.
Keep secondary actions as default buttons so the primary stays clear.