/
132
Sponsor

Milestone

Milestone Stats rendered with email-safe, renderer-native components.

import { MilestoneStats } from "@/components/email/milestone-stats";
import { defaultTheme } from "@/components/email/theme-default";

export function MilestoneStatsDemo() {
  return (
    <MilestoneStats
      variant="default"
      theme={{ ...defaultTheme, containerWidth: "640px" }}
    />
  );
}

Installation

$ pnpm dlx shadcn@latest add @emailcn/react-email/milestone-stats

Usage

import { MilestoneStats } from "@/components/email/milestone-stats";
<MilestoneStats variant="default" />

Examples

Boxed

import { MilestoneStats } from "@/components/email/milestone-stats";

export function MilestoneStatsBoxedDemo() {
  return <MilestoneStats variant="boxed" />;
}

Accent

import { MilestoneStats } from "@/components/email/milestone-stats";

export function MilestoneStatsAccentDemo() {
  return <MilestoneStats variant="accent" />;
}

API Reference

PropTypeDefaultDescription
themeEmailThemedefaultThemeRenderer theme configuration.
variant"default" | "boxed" | "accent""default"Configures the component's variant.
headingstring"Miles traveled"Configures the component's heading.
valuestring"5,685"Configures the component's value.
unitstring"miles"Configures the component's unit.
currentLevelstring"SILVER"Configures the component's currentlevel.
nextLevelstring"GOLD"Configures the component's nextlevel.
remainingstring"1,315 miles"Configures the component's remaining.
progressnumber90Configures the component's progress.
pageBackgroundColorstring"#f1f5f9"Configures the component's pagebackgroundcolor.
backgroundColorstring"#fffffe"Configures the component's backgroundcolor.
cardBackgroundColorstring"#f9fafb"Configures the component's cardbackgroundcolor.
headingColorstring"#030712"Configures the component's headingcolor.
textColorstring"#4b5563"Configures the component's textcolor.
mutedTextColorstring"#9ca3af"Configures the component's mutedtextcolor.
progressTrackColorstring"#e5e7eb"Configures the component's progresstrackcolor.
progressColorstring"#030712"Configures the component's progresscolor.