4
Sponsor

Background Image Footer

Nine background-image footer families consolidated into layout and logo-position variants

import { FooterWithBackgroundImage } from "@/components/email/footer-with-background-image";
import type { FooterWithBackgroundImageVariant } from "@/components/email/footer-with-background-image";

export function FooterWithBackgroundImageDemo({
  variant = "bottom-image-content",
}: {
  variant?: string;
}) {
  const logoPosition = variant.endsWith("-right-logo") ? "right" : "left";
  const componentVariant = variant.replace(
    /-(left|right)-logo$/,
    ""
  ) as FooterWithBackgroundImageVariant;
  return (
    <FooterWithBackgroundImage
      {...FooterWithBackgroundImage.PreviewProps}
      logoPosition={logoPosition}
      variant={componentVariant}
    />
  );
}

Installation

$ pnpm dlx shadcn@latest add @emailcn/footer-with-background-image

Usage

import { FooterWithBackgroundImage } from "@/components/email/footer-with-background-image";
<FooterWithBackgroundImage
  {...FooterWithBackgroundImage.PreviewProps}
  variant="top-image-content"
  logoPosition="left"
/>

Examples

import { FooterWithBackgroundImage } from "@/components/email/footer-with-background-image";
import type { FooterWithBackgroundImageVariant } from "@/components/email/footer-with-background-image";

export function FooterWithBackgroundImageDemo({
  variant = "bottom-image-content",
}: {
  variant?: string;
}) {
  const logoPosition = variant.endsWith("-right-logo") ? "right" : "left";
  const componentVariant = variant.replace(
    /-(left|right)-logo$/,
    ""
  ) as FooterWithBackgroundImageVariant;
  return (
    <FooterWithBackgroundImage
      {...FooterWithBackgroundImage.PreviewProps}
      logoPosition={logoPosition}
      variant={componentVariant}
    />
  );
}
import { FooterWithBackgroundImage } from "@/components/email/footer-with-background-image";
import type { FooterWithBackgroundImageVariant } from "@/components/email/footer-with-background-image";

export function FooterWithBackgroundImageDemo({
  variant = "bottom-image-content",
}: {
  variant?: string;
}) {
  const logoPosition = variant.endsWith("-right-logo") ? "right" : "left";
  const componentVariant = variant.replace(
    /-(left|right)-logo$/,
    ""
  ) as FooterWithBackgroundImageVariant;
  return (
    <FooterWithBackgroundImage
      {...FooterWithBackgroundImage.PreviewProps}
      logoPosition={logoPosition}
      variant={componentVariant}
    />
  );
}
import { FooterWithBackgroundImage } from "@/components/email/footer-with-background-image";
import type { FooterWithBackgroundImageVariant } from "@/components/email/footer-with-background-image";

export function FooterWithBackgroundImageDemo({
  variant = "bottom-image-content",
}: {
  variant?: string;
}) {
  const logoPosition = variant.endsWith("-right-logo") ? "right" : "left";
  const componentVariant = variant.replace(
    /-(left|right)-logo$/,
    ""
  ) as FooterWithBackgroundImageVariant;
  return (
    <FooterWithBackgroundImage
      {...FooterWithBackgroundImage.PreviewProps}
      logoPosition={logoPosition}
      variant={componentVariant}
    />
  );
}
import { FooterWithBackgroundImage } from "@/components/email/footer-with-background-image";
import type { FooterWithBackgroundImageVariant } from "@/components/email/footer-with-background-image";

export function FooterWithBackgroundImageDemo({
  variant = "bottom-image-content",
}: {
  variant?: string;
}) {
  const logoPosition = variant.endsWith("-right-logo") ? "right" : "left";
  const componentVariant = variant.replace(
    /-(left|right)-logo$/,
    ""
  ) as FooterWithBackgroundImageVariant;
  return (
    <FooterWithBackgroundImage
      {...FooterWithBackgroundImage.PreviewProps}
      logoPosition={logoPosition}
      variant={componentVariant}
    />
  );
}
import { FooterWithBackgroundImage } from "@/components/email/footer-with-background-image";
import type { FooterWithBackgroundImageVariant } from "@/components/email/footer-with-background-image";

export function FooterWithBackgroundImageDemo({
  variant = "bottom-image-content",
}: {
  variant?: string;
}) {
  const logoPosition = variant.endsWith("-right-logo") ? "right" : "left";
  const componentVariant = variant.replace(
    /-(left|right)-logo$/,
    ""
  ) as FooterWithBackgroundImageVariant;
  return (
    <FooterWithBackgroundImage
      {...FooterWithBackgroundImage.PreviewProps}
      logoPosition={logoPosition}
      variant={componentVariant}
    />
  );
}

Centered Content, Image Bottom

import { FooterWithBackgroundImage } from "@/components/email/footer-with-background-image";
import type { FooterWithBackgroundImageVariant } from "@/components/email/footer-with-background-image";

export function FooterWithBackgroundImageDemo({
  variant = "bottom-image-content",
}: {
  variant?: string;
}) {
  const logoPosition = variant.endsWith("-right-logo") ? "right" : "left";
  const componentVariant = variant.replace(
    /-(left|right)-logo$/,
    ""
  ) as FooterWithBackgroundImageVariant;
  return (
    <FooterWithBackgroundImage
      {...FooterWithBackgroundImage.PreviewProps}
      logoPosition={logoPosition}
      variant={componentVariant}
    />
  );
}
import { FooterWithBackgroundImage } from "@/components/email/footer-with-background-image";
import type { FooterWithBackgroundImageVariant } from "@/components/email/footer-with-background-image";

export function FooterWithBackgroundImageDemo({
  variant = "bottom-image-content",
}: {
  variant?: string;
}) {
  const logoPosition = variant.endsWith("-right-logo") ? "right" : "left";
  const componentVariant = variant.replace(
    /-(left|right)-logo$/,
    ""
  ) as FooterWithBackgroundImageVariant;
  return (
    <FooterWithBackgroundImage
      {...FooterWithBackgroundImage.PreviewProps}
      logoPosition={logoPosition}
      variant={componentVariant}
    />
  );
}
import { FooterWithBackgroundImage } from "@/components/email/footer-with-background-image";
import type { FooterWithBackgroundImageVariant } from "@/components/email/footer-with-background-image";

export function FooterWithBackgroundImageDemo({
  variant = "bottom-image-content",
}: {
  variant?: string;
}) {
  const logoPosition = variant.endsWith("-right-logo") ? "right" : "left";
  const componentVariant = variant.replace(
    /-(left|right)-logo$/,
    ""
  ) as FooterWithBackgroundImageVariant;
  return (
    <FooterWithBackgroundImage
      {...FooterWithBackgroundImage.PreviewProps}
      logoPosition={logoPosition}
      variant={componentVariant}
    />
  );
}
import { FooterWithBackgroundImage } from "@/components/email/footer-with-background-image";
import type { FooterWithBackgroundImageVariant } from "@/components/email/footer-with-background-image";

export function FooterWithBackgroundImageDemo({
  variant = "bottom-image-content",
}: {
  variant?: string;
}) {
  const logoPosition = variant.endsWith("-right-logo") ? "right" : "left";
  const componentVariant = variant.replace(
    /-(left|right)-logo$/,
    ""
  ) as FooterWithBackgroundImageVariant;
  return (
    <FooterWithBackgroundImage
      {...FooterWithBackgroundImage.PreviewProps}
      logoPosition={logoPosition}
      variant={componentVariant}
    />
  );
}
import { FooterWithBackgroundImage } from "@/components/email/footer-with-background-image";
import type { FooterWithBackgroundImageVariant } from "@/components/email/footer-with-background-image";

export function FooterWithBackgroundImageDemo({
  variant = "bottom-image-content",
}: {
  variant?: string;
}) {
  const logoPosition = variant.endsWith("-right-logo") ? "right" : "left";
  const componentVariant = variant.replace(
    /-(left|right)-logo$/,
    ""
  ) as FooterWithBackgroundImageVariant;
  return (
    <FooterWithBackgroundImage
      {...FooterWithBackgroundImage.PreviewProps}
      logoPosition={logoPosition}
      variant={componentVariant}
    />
  );
}
import { FooterWithBackgroundImage } from "@/components/email/footer-with-background-image";
import type { FooterWithBackgroundImageVariant } from "@/components/email/footer-with-background-image";

export function FooterWithBackgroundImageDemo({
  variant = "bottom-image-content",
}: {
  variant?: string;
}) {
  const logoPosition = variant.endsWith("-right-logo") ? "right" : "left";
  const componentVariant = variant.replace(
    /-(left|right)-logo$/,
    ""
  ) as FooterWithBackgroundImageVariant;
  return (
    <FooterWithBackgroundImage
      {...FooterWithBackgroundImage.PreviewProps}
      logoPosition={logoPosition}
      variant={componentVariant}
    />
  );
}
import { FooterWithBackgroundImage } from "@/components/email/footer-with-background-image";
import type { FooterWithBackgroundImageVariant } from "@/components/email/footer-with-background-image";

export function FooterWithBackgroundImageDemo({
  variant = "bottom-image-content",
}: {
  variant?: string;
}) {
  const logoPosition = variant.endsWith("-right-logo") ? "right" : "left";
  const componentVariant = variant.replace(
    /-(left|right)-logo$/,
    ""
  ) as FooterWithBackgroundImageVariant;
  return (
    <FooterWithBackgroundImage
      {...FooterWithBackgroundImage.PreviewProps}
      logoPosition={logoPosition}
      variant={componentVariant}
    />
  );
}

Image Top, Centered Content

import { FooterWithBackgroundImage } from "@/components/email/footer-with-background-image";
import type { FooterWithBackgroundImageVariant } from "@/components/email/footer-with-background-image";

export function FooterWithBackgroundImageDemo({
  variant = "bottom-image-content",
}: {
  variant?: string;
}) {
  const logoPosition = variant.endsWith("-right-logo") ? "right" : "left";
  const componentVariant = variant.replace(
    /-(left|right)-logo$/,
    ""
  ) as FooterWithBackgroundImageVariant;
  return (
    <FooterWithBackgroundImage
      {...FooterWithBackgroundImage.PreviewProps}
      logoPosition={logoPosition}
      variant={componentVariant}
    />
  );
}

Image Top, Logo Bottom

import { FooterWithBackgroundImage } from "@/components/email/footer-with-background-image";
import type { FooterWithBackgroundImageVariant } from "@/components/email/footer-with-background-image";

export function FooterWithBackgroundImageDemo({
  variant = "bottom-image-content",
}: {
  variant?: string;
}) {
  const logoPosition = variant.endsWith("-right-logo") ? "right" : "left";
  const componentVariant = variant.replace(
    /-(left|right)-logo$/,
    ""
  ) as FooterWithBackgroundImageVariant;
  return (
    <FooterWithBackgroundImage
      {...FooterWithBackgroundImage.PreviewProps}
      logoPosition={logoPosition}
      variant={componentVariant}
    />
  );
}

API Reference

PropTypeDefaultDescription
variantFooterWithBackgroundImageVariant"bottom-image-content"Selects the content shell
logoPosition"left" | "right""left"Mirrors supported layouts
themeEmailThemedefault themeEmail theme styling