Skip to content
Marketing block

In-article CTA Card

The offer that sits inside the column instead of interrupting it — a labelled aside a screen reader can skip in one keystroke, tied to the paragraph above it, with the friction admitted before the click.

132 lineslucide-reactAdded 27 Aug 2026Updated 11 Sept 2026
  • cta
  • inline
  • article
  • content
  • conversion

What's included

  • components/cta-inline-card.tsx
  • Needs lucide-react

Works with

  • React
  • Next.js
  • Tailwind CSS
  • TypeScript

npx hoverlab add cta-inline-card

Or over MCP, from your editor's agent — no account needed.

License

Free to read, copy and install, for personal and non-commercial projects. Shipping it in client work or a paid product needs Pro ($79 once). The source lands in your repo and stops being ours — no attribution, nothing to upgrade.

Was this useful?

Start a page with this section — add more, order them, and leave with the page source.

Preview

…which is why the migration queues behind the reporting job rather than failing outright. The lock is held for as long as the report runs, and on a large table that can be several minutes.

The safe version is to set a lock timeout and accept that the migration may need a second pass, rather than letting it wait indefinitely and block every write behind it.

Rendered live in your current theme — this is the same component whose source is below, not a screenshot of it.

Source

components/cta-inline-card.tsx
'use client'

/**
 * <CtaInlineCard> — the offer that sits inside the article, mid-sentence.
 *
 * CTA Sections had three full-width bands and a sticky bar: four ways of
 * interrupting the page. This is the one that does not interrupt. It sits
 * in the column, at the width of the text, after the paragraph that earned
 * it — which is a different design problem, and the reason a band pasted
 * into an article always looks like an advert somebody forgot to remove.
 *
 * THE ONE THING THIS GETS RIGHT THAT MOST DO NOT
 *
 * It is an `<aside>` with a label, so it is out of the article's reading
 * flow rather than pretending to be the next paragraph. A screen-reader
 * user can skip a labelled complementary region in one keystroke; the same
 * card built from a div lands as body text and has to be read through
 * every time, including the button. The visual break — narrower rule,
 * different surface — is the sighted version of exactly that affordance.
 *
 * IT IS ABOUT THE SECTION IT FOLLOWS
 *
 * The heading references what was just being read. An inline card offering
 * a generic "start your free trial" is the same interruption wherever it
 * lands, which is why readers learn to skip it in one article and skip it
 * in all of them afterwards.
 *
 * THE FRICTION IS STATED BEFORE THE CLICK
 *
 * "No card, about two minutes" under the button. The cost of finding that
 * out on the next page is a bounce; the cost of putting it here is one
 * line of text.
 *
 * DISMISSING IT MEANS SOMETHING
 *
 * "Not now" hides it for the rest of the visit rather than fading it back
 * in on the next scroll. A card you cannot get rid of is read as an advert
 * whether or not it is one — and in a real build this is the moment to
 * write the preference somewhere that survives a reload.
 *
 * ACCESSIBILITY: labelled `<aside>`, one `<h2>` that is a real heading in
 * the document outline, and a link styled as a button that is genuinely an
 * anchor because it navigates.
 */

import * as React from 'react'
import { ArrowRight, Sparkles, X } from 'lucide-react'

export interface CtaInlineCardProps {
  /** What the reader was just reading — the card has to answer it. */
  contextLabel?: string
  heading?: string
  body?: string
  actionLabel?: string
  href?: string
  /** The friction, admitted before the click rather than on the next page. */
  fineprint?: string
  className?: string
}

export function CtaInlineCard({
  contextLabel = 'Since you are reading about migrations',
  heading = 'Run this migration against a copy first',
  body =
    'The sandbox restores a snapshot of your production database and throws it away after an hour. It is the cheapest way to find out whether the lock timeout above is enough for your data.',
  actionLabel = 'Open a sandbox',
  href = '#sandbox',
  fineprint = 'No card. About two minutes, and it deletes itself.',
  className = '',
}: CtaInlineCardProps) {
  const [dismissed, setDismissed] = React.useState(false)

  return (
    <div className={`mx-auto w-full max-w-2xl px-4 py-16 sm:px-6 ${className}`}>
      {/* Surrounding prose, so the card is seen at the width it will live at. */}
      <p className="text-sm leading-relaxed text-muted-foreground">
        …which is why the migration queues behind the reporting job rather than
        failing outright. The lock is held for as long as the report runs, and
        on a large table that can be several minutes.
      </p>

      {dismissed ? (
        <p role="status" className="my-6 text-xs text-muted-foreground">
          Hidden for the rest of your visit.
        </p>
      ) : (
        /*
          A labelled complementary region: skippable in one keystroke, and
          out of the article's reading flow rather than posing as the next
          paragraph.
        */
        <aside
          aria-label="Related offer"
          className="relative my-6 rounded-xl border border-border bg-muted/50 p-5"
        >
          <button
            type="button"
            onClick={() => setDismissed(true)}
            className="absolute end-2 top-2 inline-flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground transition hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
          >
            <X aria-hidden className="h-3.5 w-3.5" />
            <span className="sr-only">Not now — hide this for the rest of my visit</span>
          </button>

          <p className="flex items-center gap-1.5 pe-8 text-xs font-medium uppercase tracking-wide text-muted-foreground">
            <Sparkles aria-hidden className="h-3.5 w-3.5" />
            {contextLabel}
          </p>
          <h2 className="mt-2 text-base font-semibold text-foreground">{heading}</h2>
          <p className="mt-1.5 text-sm leading-relaxed text-muted-foreground">{body}</p>

          <a
            href={href}
            className="mt-4 inline-flex h-9 items-center gap-1.5 rounded-lg bg-primary px-3.5 text-sm font-semibold text-primary-foreground transition hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background"
          >
            {actionLabel}
            <ArrowRight aria-hidden className="h-4 w-4 rtl:rotate-180" />
          </a>
          {/* The cost, before the click. */}
          <p className="mt-2 text-xs text-muted-foreground">{fineprint}</p>
        </aside>
      )}

      <p className="text-sm leading-relaxed text-muted-foreground">
        The safe version is to set a lock timeout and accept that the migration
        may need a second pass, rather than letting it wait indefinitely and
        block every write behind it.
      </p>
    </div>
  )
}

Before you paste

  • Styling is Tailwind utility classes on semantic tokens (bg-card, text-muted-foreground) — it inherits your theme instead of overriding it.
  • Install: npm i lucide-react
  • Every prop has a default, so it renders standalone before you wire it up.

Where it goes

Drop it at components/cta-inline-card.tsx and import it where you need the section:

import { CtaInlineCard } from '@/components/cta-inline-card'

Customize

5 of this block’s props are simple enough to drive from here. Change them and the block below re-renders — it is the same component whose source is above, not a mock of it. Everything else it accepts is in the table underneath.

Props

Read out of the component’s own type and signature, so this cannot drift from the source below. Every prop has a default — the component renders standalone before you pass it anything.

PropTypeDefault
contextLabelWhat the reader was just reading — the card has to answer it.string'Since you are reading about migrations'
headingstring'Run this migration against a copy first'
bodystring—
actionLabelstring'Open a sandbox'
hrefstring'#sandbox'
fineprintThe friction, admitted before the click rather than on the next page.string'No card. About two minutes, and it deletes i…
classNamestring''

Not using React?

The same block rendered once to markup, wrapped as a file your framework compiles. Tailwind classes are framework-agnostic, so the design transfers intact — the behaviour does not.

This block is interactive. The markup below is its initial state with the event handlers stripped — you will need to re-wire the behaviour in your framework.

cta-inline-card.html
<!--
  In-article CTA Card — markup from the Hoverlab catalog.

  This is the block rendered once to HTML and wrapped as a component
  file. It is not a port of the React source: the Tailwind classes carry
  the design, which is the part that took the work, and they are the same
  in every framework.

  This block is interactive in React and the handlers are NOT here.
  Buttons, toggles and menus render in their initial state and do
  nothing until you wire them up.
-->
<div class="mx-auto w-full max-w-2xl px-4 py-16 sm:px-6 ">
  <p class="text-sm leading-relaxed text-muted-foreground">…which is why the migration queues behind the reporting job rather than failing outright. The lock is held for as long as the report runs, and on a large table that can be several minutes.</p>
  <aside aria-label="Related offer" class="relative my-6 rounded-xl border border-border bg-muted/50 p-5">
    <button type="button" class="absolute end-2 top-2 inline-flex h-7 w-7 items-center justify-center rounded-lg text-muted-foreground transition hover:bg-background hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background">
      <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-x h-3.5 w-3.5" aria-hidden="true">
        <path d="M18 6 6 18"></path>
        <path d="m6 6 12 12"></path>
      </svg>
      <span class="sr-only">Not now — hide this for the rest of my visit</span>
    </button>
    <p class="flex items-center gap-1.5 pe-8 text-xs font-medium uppercase tracking-wide text-muted-foreground"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-sparkles h-3.5 w-3.5" aria-hidden="true"><path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"></path><path d="M20 3v4"></path><path d="M22 5h-4"></path><path d="M4 17v2"></path><path d="M5 18H3"></path></svg>Since you are reading about migrations</p>
    <h2 class="mt-2 text-base font-semibold text-foreground">Run this migration against a copy first</h2>
    <p class="mt-1.5 text-sm leading-relaxed text-muted-foreground">The sandbox restores a snapshot of your production database and throws it away after an hour. It is the cheapest way to find out whether the lock timeout above is enough for your data.</p>
    <a href="#sandbox" class="mt-4 inline-flex h-9 items-center gap-1.5 rounded-lg bg-primary px-3.5 text-sm font-semibold text-primary-foreground transition hover:opacity-90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background">Open a sandbox<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-right h-4 w-4 rtl:rotate-180" aria-hidden="true"><path d="M5 12h14"></path><path d="m12 5 7 7-7 7"></path></svg></a>
    <p class="mt-2 text-xs text-muted-foreground">No card. About two minutes, and it deletes itself.</p>
  </aside>
  <p class="text-sm leading-relaxed text-muted-foreground">The safe version is to set a lock timeout and accept that the migration may need a second pass, rather than letting it wait indefinitely and block every write behind it.</p>
</div>
  • This is rendered HTML, not a translation of the React source. The Tailwind classes carry the design and work in any framework.
  • It is one frame: the component in its initial state, with no props applied beyond the defaults.
  • This block is interactive in React — toggles, menus or form state. None of that survives here; the markup is the closed/default state and the handlers are gone. Re-wire them in your own framework.
  • Requires Tailwind, and the design tokens the classes reference (bg-card, text-muted-foreground, and so on). The template ZIPs ship a globals.css that defines them.

What each framework gets across the whole catalog — effects convert properly; this rung is markup.

For AI

The component, its props, the design tokens it expects and the command that installs it — as one prompt. Paste it into Claude, Cursor, v0 or ChatGPT and what they build around it will match the rest of the catalog instead of inventing its own system.

See the prompt

Used in these pages

Want the whole screen instead of this one section? Open a page and copy it entire.

6 more blocks in CTA Sections

All of them free to read, copy and install — no account, no locked tiles, no watermarked preview. The whole catalog is open, and so are the API and the CLI.

Browse CTA Sections

Shipping one commercially

Copying the code is free. Putting it in client work or a paid product is what Pro is for — the licence, not the access.

  • A commercial licence for everything in the catalog
  • Unlimited bundle exports, in Vue, Svelte and Tailwind
  • One payment — no subscription, nothing to renew
Pro — $79 once

More CTA Sections blocks

View category
Open the full page for this block

Newsletter Capture Band

Email capture with a four-state submission machine and an aria-live status line, so the outcome is announced and not just shown.

CTA Sections134 lines1 dep

Community Link Band

A closing CTA of three link cards pointing at GitHub, chat and social — somewhere to go for the visitor who is not ready to convert.

CTA Sections100 lines1 dep
Open the full page for this block

Closing CTA Panel

A rounded gradient panel that restates the offer for the reader who scrolled past everything — heading left, both CTAs right, reassurance points underneath.

CTA Sections103 lines1 dep
Open the full page for this block

Sticky Conversion Bar

The call to action that follows a long page down — held back until the reader is past a scroll threshold, dismissible, and spaced so it never covers the content it is selling.

CTA Sections178 lines1 dep
Open the full page for this block

Referral Waitlist Form

A waitlist capture that shows position and referral credit, turning a dead-end confirmation into the one action that moves the queue.

CTA Sections174 linesNo deps
Open the full page for this block

Demo Request Form

A demo request that offers the self-serve escape first, so the people who did not want a call do not book one.

CTA Sections168 linesNo deps