import { HeaderWithUserDetails } from "@/components/email/header-with-user-details";
import { defaultTheme } from "@/components/email/theme-default";
export function HeaderWithUserDetailsDemo() {
return (
<HeaderWithUserDetails
alignment="right"
avatar="initials"
theme={{ ...defaultTheme, containerWidth: "640px" }}
/>
);
}Installation
$ pnpm dlx shadcn@latest add @emailcn/jsx-email/header-with-user-details
Usage
import { HeaderWithUserDetails } from "@/components/email/header-with-user-details";<HeaderWithUserDetails alignment="right" avatar="initials" />Examples
Image avatar
import { HeaderWithUserDetails } from "@/components/email/header-with-user-details";
export function HeaderWithUserDetailsImageAvatarDemo() {
return <HeaderWithUserDetails alignment="left" avatar="image" />;
}Initials with right logo
import { HeaderWithUserDetails } from "@/components/email/header-with-user-details";
export function HeaderWithUserDetailsAvatarInitialsAlignmentRightExampleDemo() {
return <HeaderWithUserDetails avatar="initials" alignment="right" />;
}Image avatar with right logo
import { HeaderWithUserDetails } from "@/components/email/header-with-user-details";
export function HeaderWithUserDetailsAvatarImageAlignmentRightExampleDemo() {
return <HeaderWithUserDetails avatar="image" alignment="right" />;
}API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
theme | EmailTheme | defaultTheme | Renderer theme configuration. |
logoSrc | string | "https://placehold.co/320x96/0F766E/FFFFFF.png?text=Maizzle%20Insignia" | Configures the component's logosrc. |
logoAlt | string | "Maizzle" | Configures the component's logoalt. |
logoHref | string | "https://example.com" | Configures the component's logohref. |
userName | string | - | Configures the component's username. |
userEmail | string | - | Configures the component's useremail. |
initials | string | "JD" | Configures the component's initials. |
avatarSrc | string | - | Configures the component's avatarsrc. |
avatarAlt | string | "" | Configures the component's avataralt. |
avatar | "initials" | "image" | "initials" | Configures the component's avatar. |
alignment | "left" | "right" | "left" | Configures the component's alignment. |
pageBackgroundColor | string | "#f1f5f9" | Configures the component's pagebackgroundcolor. |
backgroundColor | string | "#fffffe" | Configures the component's backgroundcolor. |
avatarBackgroundColor | string | "#f3f4f6" | Configures the component's avatarbackgroundcolor. |
headingColor | string | "#030712" | Configures the component's headingcolor. |
textColor | string | "#4b5563" | Configures the component's textcolor. |
mutedTextColor | string | "#6b7280" | Configures the component's mutedtextcolor. |