
A basic-tier hero built with shadcn/ui anchor buttons, pairing padded muted-grid copy with an adjacent photograph that fills its column inside one container-wide split.
block/hero34/hero34.tsx
import { ArrowRight } from "lucide-react";
import { cn } from "cn";
import { Button } from "@/components/ui/button";
interface Image {
src: string;
alt: string;
srcDark?: string;
}
interface Button {
text: string;
url: string;
icon?: React.ReactNode;
}
interface Buttons {
primary?: Button;
secondary?: Button;
}
interface Badge {
text: string;
announcement?: string;
url?: string;
}
interface HeroBasicProps {
badge?: Badge;
heading: string;
description: string;
buttons?: Buttons;
image: Image;
className?: string;
}
interface Hero34Props extends HeroBasicProps {}
type Props = Partial<Hero34Props>;
const defaultProps: HeroBasicProps = {
badge: {
text: "Now in Beta",
announcement: "Check out our latest updates",
},
heading: "The CRM platform for modern product teams.",
description:
"An open-source project management platform built for modern product teams. Plan, track, and ship with confidence.",
buttons: {
primary: { text: "Get started", url: "#" },
secondary: { text: "Learn more", url: "#" },
},
image: {
src: "https://cdn.shadcnblocks.com/shadcnblocks/image-set/modern/saas-details/saas-detail-1-16x9.png",
alt: "Product dashboard",
},
};
const Hero34 = (props: Props) => {
const { badge, heading, description, buttons, image, className } = {
...defaultProps,
...props,
};
return (
<section className={cn("", className)}>
<div className="container">
<div className="grid items-center gap-8 bg-muted lg:grid-cols-2">
<div className="flex flex-col items-center p-16 text-center lg:items-start lg:text-left">
{badge && <p>{badge.text}</p>}
<h1 className="my-6 text-4xl font-semibold tracking-tight text-pretty lg:text-6xl">
{heading}
</h1>
<p className="mb-8 max-w-xl text-muted-foreground lg:text-xl">
{description}
</p>
<div className="flex w-full flex-col justify-center gap-2 sm:flex-row lg:justify-start">
{buttons?.primary && (
<Button asChild>
<a href={buttons.primary.url}>
{buttons.primary.text}
<ArrowRight className="size-4" />
</a>
</Button>
)}
{buttons?.secondary && (
<Button asChild variant="outline">
<a href={buttons.secondary.url}>{buttons.secondary.text}</a>
</Button>
)}
</div>
</div>
<img
src={image.src}
alt={image.alt}
className="h-full w-full object-cover"
/>
</div>
</div>
</section>
);
};
export { Hero34 };