Split hero with product window
A two-column hero: headline, one supporting sentence, primary and secondary actions and a trust row (avatar stack plus a compliance note) on the left, and a cropped app window on the right built in HTML, with a sidebar, a progress bar, a transactions table with status pills and a floating stat card. Every colour comes from theme tokens; on phones the window stacks under the copy and stays cropped instead of shrinking.
Source
import { ArrowRight, ChartColumn, FileText, Landmark, LayoutDashboard, Receipt, ShieldCheck, type LucideIcon } from "lucide-react";
import type { ReactNode } from "react";
import { cn } from "@/lib/utils";
type Action = { label: string; href: string };
export type HeroSplitProps = {
title?: string;
description?: string;
primaryAction?: Action;
secondaryAction?: Action;
/** Initials for the avatar stack in the trust row. */
avatars?: string[];
trustText?: ReactNode;
badgeText?: string;
className?: string;
};
const focusRing = "outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background";
export function HeroSplit({
title = "Close the books in an afternoon",
description = "Ledgerwell matches bank lines, invoices and receipts as they arrive, so month-end becomes a review instead of a project.",
primaryAction = { label: "Start free trial", href: "#trial" },
secondaryAction = { label: "Book a demo", href: "#demo" },
avatars = ["MR", "TO", "AK", "JL"],
trustText = <><span className="font-semibold text-foreground">2,400 finance teams</span> close with Ledgerwell</>,
badgeText = "SOC 2 Type II",
className,
}: HeroSplitProps) {
return (
<section aria-labelledby="hero-split-title" className={cn("overflow-hidden bg-background", className)}>
<div className="mx-auto grid max-w-6xl items-center gap-12 px-4 py-16 sm:px-6 sm:py-20 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.1fr)] lg:gap-14 lg:px-8 lg:py-24">
<div className="max-w-xl">
<h1
id="hero-split-title"
className="text-balance text-4xl font-semibold leading-[1.04] tracking-[-0.035em] text-foreground sm:text-5xl lg:text-[3.6rem]"
>
{title}
</h1>
<p className="mt-6 max-w-md text-lg leading-relaxed text-muted-foreground">{description}</p>
<div className="mt-9 flex flex-wrap gap-3">
<a
href={primaryAction.href}
className={cn("group inline-flex h-11 items-center gap-2 rounded-md bg-primary px-5 text-sm font-medium text-primary-foreground transition-opacity hover:opacity-90", focusRing)}
>
{primaryAction.label}
<ArrowRight className="size-4 motion-safe:transition-transform group-hover:translate-x-0.5" aria-hidden="true" />
</a>
<a
href={secondaryAction.href}
className={cn("inline-flex h-11 items-center rounded-md bg-secondary px-5 text-sm font-medium text-secondary-foreground transition-colors hover:bg-accent", focusRing)}
>
{secondaryAction.label}
</a>
</div>
<div className="mt-12 flex flex-wrap items-center gap-x-6 gap-y-4">
<div className="flex items-center gap-3">
<div className="flex -space-x-2" aria-hidden="true">
{avatars.map((initials, index) => (
<span
key={initials}
className="grid size-9 place-items-center rounded-full text-[0.6875rem] font-semibold text-foreground ring-2 ring-background"
style={{ background: `color-mix(in oklab, var(--chart-${(index % 5) + 1}) 30%, var(--background))` }}
>
{initials}
</span>
))}
</div>
<p className="text-sm text-muted-foreground">{trustText}</p>
</div>
{badgeText && (
<p className="flex items-center gap-1.5 text-sm text-muted-foreground">
<ShieldCheck className="size-4 text-foreground" aria-hidden="true" />
{badgeText}
</p>
)}
</div>
</div>
<ProductMock />
</div>
</section>
);
}
/* ——— The product picture: a cropped reconciliation screen, built in HTML so it follows the theme. ——— */
const NAV: { label: string; icon: LucideIcon; active?: boolean }[] = [
{ label: "Overview", icon: LayoutDashboard },
{ label: "Bank feeds", icon: Landmark, active: true },
{ label: "Invoices", icon: Receipt },
{ label: "Receipts", icon: FileText },
{ label: "Reports", icon: ChartColumn },
];
const ROWS: { date: string; payee: string; amount: string; status: "Matched" | "Review" }[] = [
{ date: "Mar 28", payee: "Card payout", amount: "+18,240.00", status: "Matched" },
{ date: "Mar 28", payee: "Kettle & Crumb catering", amount: "−412.80", status: "Matched" },
{ date: "Mar 27", payee: "Larchmont Freight", amount: "−2,960.00", status: "Review" },
{ date: "Mar 27", payee: "Office rent, Unit 4", amount: "−6,500.00", status: "Matched" },
{ date: "Mar 26", payee: "Pellam Studio", amount: "−1,180.00", status: "Matched" },
{ date: "Mar 26", payee: "Payroll run", amount: "−48,210.55", status: "Matched" },
{ date: "Mar 25", payee: "Harbourside Print", amount: "−326.40", status: "Matched" },
];
const BARS = [38, 52, 44, 61, 58, 72, 80];
function ProductMock() {
return (
<div
role="img"
aria-label="Ledgerwell reconciliation screen: 184 of 192 March bank lines matched, one payment waiting for review"
className="relative h-[360px] overflow-hidden rounded-xl sm:h-[460px] lg:h-[520px]"
style={{ background: "color-mix(in oklab, var(--chart-2) 16%, var(--background))" }}
>
<div
data-ui
aria-hidden="true"
className="absolute left-4 top-5 w-[600px] overflow-hidden rounded-lg bg-card text-card-foreground shadow-[0_24px_60px_-28px_rgb(0_0_0/0.45)] ring-1 ring-border sm:left-10 sm:top-10 sm:w-[640px]"
>
<div className="flex h-9 items-center gap-1.5 border-b border-border px-3">
<span className="size-2.5 rounded-full bg-foreground/15" />
<span className="size-2.5 rounded-full bg-foreground/15" />
<span className="size-2.5 rounded-full bg-foreground/15" />
<span className="ml-3 text-xs text-muted-foreground">Ledgerwell · Halden & Co</span>
</div>
<div className="flex">
<nav className="hidden w-12 shrink-0 flex-col items-center gap-1 border-r border-border py-3 sm:flex">
<span className="mb-3 grid size-7 place-items-center rounded-md bg-primary text-[0.6875rem] font-bold text-primary-foreground">H</span>
{NAV.map(({ label, icon: Icon, active }) => (
<span
key={label}
title={label}
className={cn("grid size-8 place-items-center rounded-md", active ? "bg-muted text-foreground" : "text-muted-foreground")}
>
<Icon className="size-4" />
</span>
))}
</nav>
<div className="min-w-0 flex-1 p-4 sm:p-5">
<div className="flex items-baseline justify-between gap-4">
<p className="text-sm font-semibold">March close</p>
<p className="text-xs text-muted-foreground">Operating account ··4021</p>
</div>
<div className="mt-3 flex items-center gap-3">
<div className="h-1.5 flex-1 overflow-hidden rounded-full bg-muted">
<div className="h-full w-[96%] rounded-full bg-chart-2" />
</div>
<p className="text-xs tabular-nums text-muted-foreground"><span className="font-medium text-foreground">184</span> of 192 matched</p>
</div>
<table className="mt-4 w-full text-left text-xs">
<thead className="text-muted-foreground">
<tr className="border-b border-border">
<th className="hidden py-2 pr-3 font-normal sm:table-cell">Date</th>
<th className="py-2 pr-3 font-normal">Description</th>
<th className="py-2 pr-3 text-right font-normal">Amount</th>
<th className="py-2 font-normal">Status</th>
</tr>
</thead>
<tbody>
{ROWS.map((row) => (
<tr key={row.payee} className="border-b border-border/70 last:border-0">
<td className="hidden whitespace-nowrap py-2.5 pr-3 text-muted-foreground sm:table-cell">{row.date}</td>
<td className="whitespace-nowrap py-2.5 pr-3 font-medium">{row.payee}</td>
<td className="whitespace-nowrap py-2.5 pr-3 text-right tabular-nums">{row.amount}</td>
<td className="py-2.5">
<span
className={cn(
"inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[0.6875rem] font-medium",
row.status === "Matched"
? "bg-emerald-500/12 text-emerald-700 dark:text-emerald-300"
: "bg-amber-500/15 text-amber-700 dark:text-amber-300",
)}
>
<span className="size-1.5 rounded-full bg-current" />
{row.status}
</span>
</td>
</tr>
))}
</tbody>
</table>
</div>
</div>
</div>
<div
aria-hidden="true"
className="absolute bottom-4 right-4 w-44 rounded-lg bg-popover p-4 text-popover-foreground shadow-[0_18px_40px_-16px_rgb(0_0_0/0.4)] ring-1 ring-border sm:bottom-8 sm:right-8 sm:w-52"
>
<p className="text-xs text-muted-foreground">Hours saved in March</p>
<p className="mt-1 text-2xl font-semibold tracking-tight tabular-nums">31 h</p>
<div className="mt-3 flex h-10 items-end gap-1.5">
{BARS.map((height, index) => (
<span
key={index}
className={cn("flex-1 rounded-sm", index === BARS.length - 1 ? "bg-chart-1" : "bg-foreground/12")}
style={{ height: `${height}%` }}
/>
))}
</div>
</div>
</div>
);
}
