Staaarter

Diagonal Split Image CTA

A bold, editorial call-to-action: two full-bleed images fill the section, divided by a diagonal seam via clip-path, each slowly panning in a slightly different direction on its own timer. A heading, description, and two buttons sit centered on top in a blurred card for legibility.

By Staaarter Team
CTA
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its button, media-slot dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/diagonal-split-image-cta.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/cta/cta50.tsx instead.

Usage

The file also exports cta50Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Cta50, cta50Demo } from "@/components/blocks/cta/cta50";

export default function Page() {
  return <Cta50 {...cta50Demo} />;
}

Props

PropTypeDefaultDescription
headingstring"Two sides, one vision"Heading inside the centered overlay card.
descriptionstringnoneSupporting paragraph inside the overlay card.
primaryLabelstring"Start a project"Label for the primary button.
primaryHrefstring"#"Href for the primary button.
secondaryLabelstring"View our work"Label for the secondary button.
secondaryHrefstring"#"Href for the secondary button.
leftImageMediaSlotImagenoneImage filling the left diagonal half.
rightImageMediaSlotImagenoneImage filling the right diagonal half.
classNamestringnoneExtra classes for the outer section element.

Behavior notes

  • The diagonal seam is a `clip-path: polygon(...)` on each image's wrapping div (inline style, since Tailwind has no diagonal-clip utility for arbitrary custom angles); the two polygons share the same boundary points so there's no gap or overlap between halves.
  • Each half's slow panning is a pure CSS @keyframes loop that alternates a scale+translate transform (`animation-direction: alternate` via the Tailwind arbitrary `_infinite_alternate` suffix), not JavaScript; the two halves use distinct keyframe names (cta50-pan-left/right) with slightly different durations and directions so the motion reads as independent. Both carry `motion-reduce:animate-none`.
  • Images are pre-scaled (`scale(1.15)` baseline in the keyframes) so the panning translate never reveals an empty edge.
  • Fully static Server Component: no event handlers, no client state.