5
Sponsor

Avatars

Avatar Call To Action rendered with email-safe, renderer-native components.

import { AvatarCallToAction } from "@/components/email/avatar-call-to-action";
import { defaultTheme } from "@/components/email/theme-default";

export function AvatarCallToActionDemo() {
  return (
    <AvatarCallToAction
      placement="inline"
      theme={{ ...defaultTheme, containerWidth: "640px" }}
    />
  );
}

Installation

$ pnpm dlx shadcn@latest add @emailcn/mjml-react/avatar-call-to-action

Usage

import { AvatarCallToAction } from "@/components/email/avatar-call-to-action";
<AvatarCallToAction placement="inline" />

Examples

CTA with team avatars

default

import { AvatarCallToAction } from "@/components/email/avatar-call-to-action";

export function AvatarCallToActionPlacementInlineExampleDemo() {
  return <AvatarCallToAction placement="inline" />;
}

avatars top

import { AvatarCallToAction } from "@/components/email/avatar-call-to-action";

export function AvatarCallToActionPlacementTopExampleDemo() {
  return <AvatarCallToAction placement="top" />;
}

single avatar

import { AvatarCallToAction } from "@/components/email/avatar-call-to-action";
import { emailAsset } from "@/components/email/email-assets";

export function AvatarCallToActionPlacementInlineAvatarsExampleDemo() {
  return (
    <AvatarCallToAction
      placement="inline"
      avatars={[
        {
          alt: "Team member",
          src: emailAsset("avatars/avatar-1.jpg"),
        },
      ]}
    />
  );
}

API Reference

PropTypeDefaultDescription
themeEmailThemedefaultThemeRenderer theme configuration.
headingstring-Configures the component's heading.
descriptionstring-Configures the component's description.
actionsArray<{ href: string; label: string }>-Configures the component's actions.
avatarsArray<{ src: string; alt?: string }>-Configures the component's avatars.
placement"top" | "inline""inline"Configures the component's placement.