CTA: split benefits panel
A call to action beside a concise checklist of included benefits.
pnpm dlx shadcn@latest add @haze/cta-split-benefits---
import { ArrowRight, Check } from "@lucide/astro";
import { cn } from "../../../lib/haze/utils";
import Button from "../ui/button.astro";
interface Props {
id?: string;
eyebrow?: string;
title?: string;
description?: string;
headingLevel?: 1 | 2 | 3;
actionLabel?: string;
actionHref?: string;
benefits?: string[];
class?: string;
}
const {
id = "cta-split-benefits",
eyebrow = "Get started",
title = "Bring your next project into focus",
description = "Start with a shared space for the people, plans and decisions that move your work forward.",
headingLevel = 2,
actionLabel = "See what's included",
actionHref,
benefits = ["One home for project context", "Updates everyone can find", "A clear next step for every owner"],
class: className,
} = Astro.props;
const Heading = ({ 1: "h1", 2: "h2", 3: "h3" } as const)[headingLevel];
---
<section aria-labelledby={`${id}-title`} class={cn("bg-background px-6 py-20 sm:py-24", className)}>
<div class="mx-auto grid max-w-6xl overflow-hidden rounded-2xl border border-border bg-card lg:grid-cols-2">
<div class="p-7 sm:p-10 lg:p-12">
<p class="text-[0.6875rem]/4 font-medium tracking-wider text-muted-foreground uppercase">{eyebrow}</p>
<Heading id={`${id}-title`} class="mt-3 text-3xl/9 font-semibold tracking-tight text-balance text-foreground sm:text-4xl/11">{title}</Heading>
<p class="mt-4 max-w-lg text-base/7 text-pretty text-muted-foreground">{description}</p>
<div class="mt-8"><Button href={actionHref || `#${id}-benefits`} size="lg">{actionLabel}<ArrowRight aria-hidden="true" class="size-4" /></Button></div>
</div>
<div id={`${id}-benefits`} class="border-t border-border bg-muted/40 p-7 sm:p-10 lg:border-t-0 lg:border-l lg:p-12">
<p class="text-[0.6875rem]/4 font-medium tracking-wider text-muted-foreground uppercase">Included</p>
<ul class="mt-5 grid gap-4">
{benefits.map((benefit) => <li class="flex items-start gap-3 text-sm/6 text-foreground"><span class="mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-full bg-foreground/8"><Check aria-hidden="true" class="size-3" /></span>{benefit}</li>)}
</ul>
</div>
</div>
</section>When to use
- An action needs a short explanation of what is included
- The page has a few benefits that support a single next step
When not to use
- Two equally prominent actions need a centered layout; use cta-banner
Installation
Add the Haze registry to components.json once, then install CTA: split benefits panel with the shadcn CLI. Works in any Astro project with Tailwind CSS v4.
pnpm dlx shadcn@latest add @haze/cta-split-benefitsnpx shadcn@latest add @haze/cta-split-benefitsyarn dlx shadcn@latest add @haze/cta-split-benefitsbunx --bun shadcn@latest add @haze/cta-split-benefitsFirst time? Registry and theme setup
1. Add to components.json:
{
"registries": {
"@haze": "http://localhost:4329/r/{name}.json"
}
}2. Install the theme once: npx shadcn@latest add @haze/theme, then import it after Tailwind in your global CSS:@import "./haze.css";
API reference
| Prop | Type | Default | Description |
|---|---|---|---|
| id | string | "cta-split-benefits" | Unique section and benefits anchor prefix. |
| eyebrow | string | "Get started" | Label above the title. |
| title | string | demo heading | Call-to-action heading. |
| description | string | demo copy | Supporting explanation. |
| headingLevel | 1 | 2 | 3 | 2 | Heading level for the page context. |
| actionLabel | string | "See what's included" | Text for the primary action. |
| actionHref | string | – | Action destination; defaults to the local benefits list. |
| benefits | string[] | 3 example benefits | Short benefits presented as a list. |
| class | string | – | Additional section classes. |
Keyboard interactions
- Tab, Enter
- Focus and follow the action link.
Accessibility
- Benefits are a semantic list, with check icons hidden from assistive technology.
- The default action links to the benefits list; set a destination and matching label for a production call to action.
Notes for AI
Copy into Claude Code, Cursor, Codex or any coding agent. Agents can also read the Markdown version of this page.
Install and use
Install the Haze UI block "CTA: split benefits panel" with `npx shadcn@latest add @haze/cta-split-benefits`. If components.json has no "@haze" registry yet, add "registries": { "@haze": "http://localhost:4329/r/{name}.json" }. If src/styles/haze.css does not exist yet, run `npx shadcn@latest add @haze/theme` once and import it from the global stylesheet after Tailwind. The CLI stops at an overwrite question when a Haze file already exists and differs, even with --yes, and then installs nothing after it: read its output. If the user has not edited their Haze files, re-run with --overwrite to take the registry versions; if they have, ask them before overwriting. Then import CtaSplitBenefits from "@/components/haze/blocks/cta-split-benefits.astro" (or the relative path) and render it where it fits the page. Keep Haze token classes (bg-background, text-muted-foreground, border-border...) and never hardcode colors. Docs: http://localhost:4329/blocks/cta-split-benefits.md
Customize with real content
Adapt the Haze cta-split-benefits block for our product. Replace the demo values of these props with our real content: id, eyebrow, title, description, headingLevel, actionLabel, actionHref, benefits, class. Keep the layout, the heading level rules and these accessibility details: Benefits are a semantic list, with check icons hidden from assistive technology. The default action links to the benefits list; set a destination and matching label for a production call to action. Do not add raw color classes; use the Haze tokens.
Choose the right block
Before using cta-split-benefits, check it fits: use it when an action needs a short explanation of what is included; the page has a few benefits that support a single next step. Avoid it when two equally prominent actions need a centered layout; use cta-banner. Alternatives: @haze/cta-banner.
Dependencies
- npm: @lucide/astro
- @haze/button
- @haze/utils
- @haze/theme (one-time setup)
Source · Original Haze UI work.