/
132
Sponsor

Badge

Header With Logo And Badge rendered with email-safe, renderer-native components.

import { HeaderWithLogoAndBadge } from "@/components/email/header-with-logo-and-badge";
import { defaultTheme } from "@/components/email/theme-default";

export function HeaderWithLogoAndBadgeDemo() {
  return <HeaderWithLogoAndBadge alignment="left" theme={defaultTheme} />;
}

Installation

$ pnpm dlx shadcn@latest add @emailcn/mjml-react/header-with-logo-and-badge

Usage

import { HeaderWithLogoAndBadge } from "@/components/email/header-with-logo-and-badge";
<HeaderWithLogoAndBadge alignment="left" />

Examples

Centered

import { HeaderWithLogoAndBadge } from "@/components/email/header-with-logo-and-badge";

export function HeaderWithLogoAndBadgeCenteredDemo() {
  return <HeaderWithLogoAndBadge alignment="center" />;
}
import { HeaderWithLogoAndBadge } from "@/components/email/header-with-logo-and-badge";

export function HeaderWithLogoAndBadgeAlignmentRightExampleDemo() {
  return <HeaderWithLogoAndBadge alignment="right" />;
}

API Reference

PropTypeDefaultDescription
themeEmailThemedefaultThemeRenderer theme configuration.
logoSrcstring"https://placehold.co/320x96/0F766E/FFFFFF.png?text=Maizzle%20Insignia"Configures the component's logosrc.
logoAltstring"Maizzle"Configures the component's logoalt.
logoHrefstring"https://example.com"Configures the component's logohref.
badgeLabelstring"FREE SHIPPING"Configures the component's badgelabel.
messagestring"On orders over $65"Configures the component's message.
alignment"left" | "center" | "right""left"Configures the component's alignment.
pageBackgroundColorstring"#f1f5f9"Configures the component's pagebackgroundcolor.
backgroundColorstring"#fffffe"Configures the component's backgroundcolor.
badgeBackgroundColorstring"#eff6ff"Configures the component's badgebackgroundcolor.
badgeBorderColorstring"#dbeafe"Configures the component's badgebordercolor.
badgeColorstring"#2563eb"Configures the component's badgecolor.
badgeTextColorstring"#4b5563"Configures the component's badgetextcolor.