Email Preview Frame
Inbox style preview frame showing the sender and subject above the rendered email body. Handy for template galleries and email settings screens.
src/registry/ui/email-preview-frame.tsx/r/email-preview-frame.json
Installation#
bash
npx shadcn@latest add @minidev/email-preview-frame
MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/email-preview-frame.json
Usage#
tsx
import { EmailPreviewFrame } from "@/components/ui/email-preview-frame"
export function Example() {
return (
<EmailPreviewFrame subject="Verify your email">
<EmailLayout>
<EmailHeader />
<div className="space-y-3 px-6 py-6">
<h1 className="text-xl font-medium text-fg">Confirm it is you</h1>
<p className="text-sm text-fg-muted">Click below to verify aman@minidev.pro.</p>
<EmailButton>Verify email</EmailButton>
</div>
<EmailCard title="Did not request this?">Ignore this message — your account stays unchanged.</EmailCard>
<EmailFooter />
</EmailLayout>
</EmailPreviewFrame>
)
}
API reference#
| Prop | Type | Default |
|---|---|---|
subject* | string | - |
from | string | "hello@minidev.pro" |
children* | React.ReactNode | - |
className | string | - |
* required
Examples#
Related email components#
Email ButtonSolid link button for email templates with a fixed height, padding and rounded corners. Uses an anchor so it survives email clients that strip buttons.Email CardContent card for transactional emails with an optional title and body text, inset from the email edges. Use it for receipts, codes and highlights.Email FooterEmail footer with your company address and Unsubscribe and Preferences links, centered on a muted background. Covers what marketing emails need at the end.Email HeaderSimple email header band that shows your brand name on a muted background with a bottom border. Sits at the top of the email layout in React templates.Email LayoutEmail layout shell with a centered 560px column, rounded border and surface background. Compose it with the email header, cards, button and footer.Email ReceiptA payment receipt email in a preview frame with a branded header, plan and tax line items, a bold total and a footer. A React starting point for billing mail.
All email templates