0
Sponsor

Hero

A hero section with heading, subheading, and CTA button.

Installation

$ pnpm dlx shadcn@latest add @emailcn/hero

Usage

import { Hero } from "@/components/emails/hero";
<Hero {...Hero.PreviewProps} />

Variants

The Hero component supports three visual variants that change the layout and positioning of the content.

Default

The default variant displays content centered with a clean, standard layout. This is ideal for most email designs where you want a balanced, professional look.

<Hero
  variant="default"
  heading="Welcome"
  subheading="Get started with your account"
  ctaLabel="Get Started"
  ctaHref="#"
/>

Slanted Left

The slanted left variant positions content toward the left side of the hero section, creating an asymmetric layout. This variant is useful when you want to create visual interest or have supporting imagery on the right side.

<Hero
  variant="slanted-left"
  heading="Welcome"
  subheading="Get started with your account"
  ctaLabel="Get Started"
  ctaHref="#"
/>

Slanted Right

The slanted right variant positions content toward the right side of the hero section. This variant works well when you want imagery or additional elements on the left side of the hero.

<Hero
  variant="slanted-right"
  heading="Welcome"
  subheading="Get started with your account"
  ctaLabel="Get Started"
  ctaHref="#"
/>

API Reference

Hero

PropTypeDefaultDescription
themeEmailThemedefaultThemeEmail theme styling
variant"default" | "slanted-left" | "slanted-right""default"Visual variant
headingstring"Welcome"Main heading text
subheadingstring"Get started with your account"Subheading text
ctaLabelstring"Get Started"CTA button label
ctaHrefstring"#"CTA button link
align"left" | "center""center"Text alignment