import { CouponsWithCenteredText } from "@/components/email/coupons-with-centered-text";
import { defaultTheme } from "@/components/email/theme-default";
export function CouponsWithCenteredTextDemo() {
return (
<CouponsWithCenteredText
variant="impact"
theme={{ ...defaultTheme, containerWidth: "640px" }}
/>
);
}Installation
$ pnpm dlx shadcn@latest add @emailcn/react-email/coupons-with-centered-text
Usage
import { CouponsWithCenteredText } from "@/components/email/coupons-with-centered-text";<CouponsWithCenteredText variant="impact" />Examples
Inline
import { CouponsWithCenteredText } from "@/components/email/coupons-with-centered-text";
export function CouponsWithCenteredTextInlineDemo() {
return <CouponsWithCenteredText variant="inline" />;
}Background
import { CouponsWithCenteredText } from "@/components/email/coupons-with-centered-text";
export function CouponsWithCenteredTextBackgroundDemo() {
return <CouponsWithCenteredText variant="impact-background" />;
}Alternate
import { CouponsWithCenteredText } from "@/components/email/coupons-with-centered-text";
export function CouponsWithCenteredTextAlternateDemo() {
return <CouponsWithCenteredText variant="impact-alt" />;
}API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
theme | EmailTheme | defaultTheme | Renderer theme configuration. |
overline | string | "Our biggest sale of the year" | Configures the component's overline. |
discount | string | "20% OFF" | Configures the component's discount. |
code | string | "WINTER20OFF" | Configures the component's code. |
expiry | string | "until 31/10/2025" | Configures the component's expiry. |
description | string | "Use code: WINTER20OFF at checkout, or click the link below to automatically apply the discount to your order." | Configures the component's description. |
backgroundImageSrc | string | "https://picsum.photos/seed/emailcn-coupons-pattern/800/600.jpg" | Configures the component's backgroundimagesrc. |
buttonLabel | string | "Shop now" | Configures the component's buttonlabel. |
buttonHref | string | "https://example.com" | Configures the component's buttonhref. |
arrowIconSrc | string | "https://placehold.co/64x64/C2410C/FFFFFF.png?text=Arrow%20Right" | Configures the component's arrowiconsrc. |
pageBackgroundColor | string | "#f1f5f9" | Configures the component's pagebackgroundcolor. |
backgroundColor | string | "#fffffe" | Configures the component's backgroundcolor. |
codeBackgroundColor | string | "#f3f4f6" | Configures the component's codebackgroundcolor. |
headingColor | string | "#030712" | Configures the component's headingcolor. |
textColor | string | "#4b5563" | Configures the component's textcolor. |
buttonBackgroundColor | string | "#4f46e5" | Configures the component's buttonbackgroundcolor. |
buttonColor | string | "#fffffe" | Configures the component's buttoncolor. |
variant | "impact" | "inline" | "impact-alt" | "impact-background" | "impact" | Configures the component's variant. |