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
| Prop | Type | Default | Description |
|---|---|---|---|
theme | EmailTheme | defaultTheme | Renderer theme configuration. |
variant | "default" | "boxed" | "accent" | "default" | Configures the component's variant. |
heading | string | "Miles traveled" | Configures the component's heading. |
value | string | "5,685" | Configures the component's value. |
unit | string | "miles" | Configures the component's unit. |
currentLevel | string | "SILVER" | Configures the component's currentlevel. |
nextLevel | string | "GOLD" | Configures the component's nextlevel. |
remaining | string | "1,315 miles" | Configures the component's remaining. |
progress | number | 90 | Configures the component's progress. |
pageBackgroundColor | string | "#f1f5f9" | Configures the component's pagebackgroundcolor. |
backgroundColor | string | "#fffffe" | Configures the component's backgroundcolor. |
cardBackgroundColor | string | "#f9fafb" | Configures the component's cardbackgroundcolor. |
headingColor | string | "#030712" | Configures the component's headingcolor. |
textColor | string | "#4b5563" | Configures the component's textcolor. |
mutedTextColor | string | "#9ca3af" | Configures the component's mutedtextcolor. |
progressTrackColor | string | "#e5e7eb" | Configures the component's progresstrackcolor. |
progressColor | string | "#030712" | Configures the component's progresscolor. |