Themes
Ecommerce
UI Elements
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
| Prop | Type | Default | Description |
|---|---|---|---|
theme | EmailTheme | defaultTheme | Email theme styling |
variant | "default" | "slanted-left" | "slanted-right" | "default" | Visual variant |
heading | string | "Welcome" | Main heading text |
subheading | string | "Get started with your account" | Subheading text |
ctaLabel | string | "Get Started" | CTA button label |
ctaHref | string | "#" | CTA button link |
align | "left" | "center" | "center" | Text alignment |