02Receipt / order confirmation email
The order-confirmation email sent right after checkout — tap 'view receipt' and the itemized order really expands.
Best forAuto-sent receipt right after checkout completes
grid-template-rowsaria-expandedmso conditional comment

<main class="stage">
<div class="ema is-demo" id="ema">
<!--[if mso]>
<table role="presentation" width="100%" cellpadding="0" cellspacing="0"><tr><td>
<![endif]-->
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" class="ema__table">
<tr><td align="center" class="ema__wrap">
<table role="presentation" width="100%" cellpadding="0" cellspacing="0" class="ema__card" style="max-width:400px">
<tr><td class="ema__brand">◆ Acme</td></tr>
<tr><td align="center" class="ema__hero"><span class="ema__badge" aria-hidden="true">🧾</span></td></tr>
<tr><td align="center" class="ema__title">Your order is confirmed</td></tr>
<tr><td align="center" class="ema__body">Payment for order #48213 is complete.<br>Check your receipt below.</td></tr>
<tr><td align="center" class="ema__ctawrap">
<table role="presentation" cellpadding="0" cellspacing="0"><tr>
<td class="ema__ctabtn"><a href="#" role="button" class="ema__cta" id="cta">View receipt</a></td>
</tr></table>
</td></tr>
<tr><td class="ema__detailrow"><button type="button" class="ema__detailtoggle" id="detailtoggle" aria-expanded="false" aria-controls="detail">2 items · 32,800 won total</button><div class="ema__detail" id="detail"><div class="ema__detailin"><div class="ema__li"><span>Basic T-shirt · 1</span><span>18,900 won</span></div><div class="ema__li"><span>Sock set · 1</span><span>13,900 won</span></div></div></div></td></tr>
<tr><td align="center" class="ema__footer">Acme Inc · Seoul · <a href="#" class="ema__unsub">Unsubscribe</a></td></tr>
</table>
</td></tr>
</table>
<!--[if mso]>
</td></tr></table>
<![endif]-->
</div>
<button type="button" class="ema-darktoggle" id="darktoggle" aria-pressed="false">Preview dark mode</button>
</main>@use "../../../../site/static/demo-tokens" as *;
$duration: $dur-base;
$easing: $ease-spring;
$color: $subject-blue;
@include stage($stage-yellow);
.stage { position: relative; }
.ema { width: min(100%, 400px); }
.ema__table { border-collapse: collapse; }
.ema__wrap { padding: 0; }
.ema__card {
border-collapse: collapse; background: $stage-paper; border-radius: $r-card;
box-shadow: $shadow-raised; overflow: hidden;
}
.ema__card td { padding: $sp-1 $sp-5; font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif; -webkit-text-size-adjust: 100%; line-height: 1; }
.ema__brand { font-weight: 800; font-size: 11px; line-height: 1;
font-family: inherit; color: rgba($subject-ink, .72); letter-spacing: .02em; padding-top: $sp-2 !important; }
.ema__hero { padding-top: $sp-1 !important; padding-bottom: $sp-1 !important; }
.ema__badge {
display: inline-flex; align-items: center; justify-content: center;
width: clamp(26px, 8vw, 34px); height: clamp(26px, 8vw, 34px);
border-radius: 50%; background: $subject-blue; font-size: clamp(13px, 4vw, 16px); line-height: 1;
}
.ema__title { font-weight: 800; font-size: clamp(12px, 3.6vw, 14px); line-height: 1.25;
font-family: inherit; color: $subject-ink; padding-top: $sp-1 !important; padding-bottom: $sp-1 !important; }
.ema__body { font-weight: 500; font-size: clamp(10px, 3vw, 11px); line-height: 1.4;
font-family: inherit; color: rgba(23,20,26,.62); padding-top: 0 !important; padding-bottom: $sp-1 !important; }
.ema__ctawrap { padding-top: $sp-1 !important; padding-bottom: $sp-1 !important; }
.ema__ctabtn { border-radius: $r-control; background: $subject-blue; }
.ema__cta {
display: inline-block; padding: $sp-1 $sp-6; font-weight: 700; font-size: 11px; line-height: 1.6;
font-family: inherit;
color: $stage-paper; text-decoration: none; border-radius: $r-control;
}
.ema__footer { font-weight: 500; font-size: 8px; line-height: 1.4;
font-family: inherit; color: rgba($subject-ink, .72); padding-top: $sp-2 !important; padding-bottom: $sp-2 !important; }
.ema__footer a { color: inherit; }
// ── 다크모드 미리보기(수동 토글) + prefers-color-scheme(자동) — 실제 이메일 클라이언트 지원 흉내
.ema.is-dark .ema__card { background: $stage-ink; }
.ema.is-dark .ema__title { color: $subject-cream; }
.ema.is-dark .ema__body,
.ema.is-dark .ema__footer { color: rgba(255,247,230,.6); }
.ema.is-dark .ema__brand { color: rgba(255,247,230,.7); }
// 다크 카드 위 추가 줄 — 밝은 모드의 rgba($subject-ink,.72) 가 그대로 남으면 잉크 면 위 잉크 글자(1.00:1)라 안 보인다 (2026-09-13 대비 스캔)
.ema.is-dark .ema__detailtoggle, .ema.is-dark .ema__li { color: rgba(255,247,230,.72); }
@media (prefers-color-scheme: dark) {
.ema__card { background: $stage-ink; }
.ema__title { color: $subject-cream; }
.ema__body, .ema__footer { color: rgba(255,247,230,.6); }
.ema__brand { color: rgba(255,247,230,.7); }
.ema__detailtoggle, .ema__li { color: rgba(255,247,230,.72); }
}
// 레이아웃 흐름에서 빼 카드 높이에 영향을 주지 않는다 (480×300 무대에 맞추려고)
.ema-darktoggle {
position: absolute; top: $sp-2; right: $sp-2;
background: $stage-ink; border: 1px solid rgba(255,247,230,.3);
color: $subject-cream; border-radius: $r-pill; padding: $sp-1 $sp-3; font-weight: 600; font-size: 9px; line-height: 1.4;
font-family: inherit; cursor: pointer;
font-family: inherit;
}
.ema__badge { position: relative; overflow: hidden; }
.ema.is-demo .ema__badge::after {
content: ""; position: absolute; inset: 0; border-radius: 50%;
background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%);
transform: translateX(-120%);
}
.ema.is-demo .ema__badge::after { animation: ema-sweep 2s linear infinite; }
@keyframes ema-sweep { 0% { transform: translateX(-120%); } 90%, 100% { transform: translateX(120%); } }
.ema__detailrow { padding-top: 0 !important; }
.ema__detailtoggle {
width: 100%; text-align: left; background: none; border: none; cursor: pointer;
font-weight: 600; font-size: 12px; line-height: 1.4;
font-family: inherit; color: rgba($subject-ink, .72); padding: $sp-1 0;
}
.ema__detail { display: grid; grid-template-rows: 0fr; transition: grid-template-rows $dur-base $ease-spring; }
.ema__detailin { overflow: hidden; }
.ema.is-open .ema__detail { grid-template-rows: 1fr; }
.ema__li { display: flex; justify-content: space-between; font-weight: 500; font-size: 11px; line-height: 1.6;
font-family: inherit; color: rgba($subject-ink, .72); padding: $sp-1 0; border-top: 1px solid rgba(0,0,0,.06); }
// 320×200 폰 실측(BD9 규칙)에서 6개 항목(추가 줄이 있는 02·03·04·05·06·07)이 10~46px 넘쳐
// 행마다 세로 패딩을 !important 로 다시 줄인다 (가로 폭만 줄이던 첫 시도로는 안 됐다 — 실측 2026-09-11)
@media (max-width: 340px), (max-height: 220px) {
.ema__card td { padding-left: $sp-3; padding-right: $sp-3; padding-top: 0; padding-bottom: 0; }
.ema__brand { padding-top: 0 !important; font-size: 9px !important; }
.ema__hero { padding-top: 0 !important; padding-bottom: 0 !important; }
.ema__badge { width: 22px; height: 22px; font-size: 11px; }
.ema__title { font-size: 10px !important; padding-top: 0 !important; padding-bottom: 0 !important; }
.ema__body { font-size: 8px !important; padding-bottom: 0 !important; }
.ema__ctawrap { padding-top: 0 !important; padding-bottom: 0 !important; }
.ema__cta { padding: 0 $sp-5 !important; }
.ema__footer { font-size: 7px !important; padding-top: $sp-1 !important; padding-bottom: $sp-1 !important; }
.ema-darktoggle { font-size: 8px; padding: 0 $sp-2; top: $sp-1; right: $sp-1; }
// 항목별 "extra" 줄(펼침 버튼·카운트다운·안읽음·복사·금액) 공통 압축 — 해당 클래스가 없는 항목엔 영향 없음
.ema__detailtoggle, .ema__countdown, .ema__unreadrow, .ema__amount, .ema__copyrow, .ema__steprow {
padding-top: 0 !important; padding-bottom: 0 !important; font-size: 9px !important;
}
.ema__li { padding: 0 $sp-3 !important; font-size: 9px !important; }
.ema__track { margin-bottom: 0 !important; }
.ema__copybtn { padding: 0 $sp-2 !important; }
}
@media (prefers-reduced-motion: reduce) {
.ema.is-demo .ema__badge,
.ema.is-demo .ema__fill,
.ema.is-demo .ema__badge::after { animation: none !important; }
.ema__detail, .ema__card, .ema__cta { transition: none; }
}html, body {
margin: 0;
overflow: hidden;
}
.stage {
box-sizing: border-box;
min-height: 100vh;
display: grid;
place-items: center;
margin: 0;
background: #ffd23f;
font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
padding: clamp(8px, 4vw, 24px);
}
.stage {
position: relative;
}
.ema {
width: min(100%, 400px);
}
.ema__table {
border-collapse: collapse;
}
.ema__wrap {
padding: 0;
}
.ema__card {
border-collapse: collapse;
background: #ffffff;
border-radius: 16px;
box-shadow: 0 14px 24px rgba(23, 20, 26, 0.32);
overflow: hidden;
}
.ema__card td {
padding: 4px 20px;
font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
-webkit-text-size-adjust: 100%;
line-height: 1;
}
.ema__brand {
font-weight: 800;
font-size: 11px;
line-height: 1;
font-family: inherit;
color: rgba(23, 20, 26, 0.72);
letter-spacing: 0.02em;
padding-top: 8px !important;
}
.ema__hero {
padding-top: 4px !important;
padding-bottom: 4px !important;
}
.ema__badge {
display: inline-flex;
align-items: center;
justify-content: center;
width: clamp(26px, 8vw, 34px);
height: clamp(26px, 8vw, 34px);
border-radius: 50%;
background: #2f6df6;
font-size: clamp(13px, 4vw, 16px);
line-height: 1;
}
.ema__title {
font-weight: 800;
font-size: clamp(12px, 3.6vw, 14px);
line-height: 1.25;
font-family: inherit;
color: #17141a;
padding-top: 4px !important;
padding-bottom: 4px !important;
}
.ema__body {
font-weight: 500;
font-size: clamp(10px, 3vw, 11px);
line-height: 1.4;
font-family: inherit;
color: rgba(23, 20, 26, 0.62);
padding-top: 0 !important;
padding-bottom: 4px !important;
}
.ema__ctawrap {
padding-top: 4px !important;
padding-bottom: 4px !important;
}
.ema__ctabtn {
border-radius: 12px;
background: #2f6df6;
}
.ema__cta {
display: inline-block;
padding: 4px 24px;
font-weight: 700;
font-size: 11px;
line-height: 1.6;
font-family: inherit;
color: #ffffff;
text-decoration: none;
border-radius: 12px;
}
.ema__footer {
font-weight: 500;
font-size: 8px;
line-height: 1.4;
font-family: inherit;
color: rgba(23, 20, 26, 0.72);
padding-top: 8px !important;
padding-bottom: 8px !important;
}
.ema__footer a {
color: inherit;
}
.ema.is-dark .ema__card {
background: #17141a;
}
.ema.is-dark .ema__title {
color: #fff7e6;
}
.ema.is-dark .ema__body,
.ema.is-dark .ema__footer {
color: rgba(255, 247, 230, 0.6);
}
.ema.is-dark .ema__brand {
color: rgba(255, 247, 230, 0.7);
}
.ema.is-dark .ema__detailtoggle, .ema.is-dark .ema__li {
color: rgba(255, 247, 230, 0.72);
}
@media (prefers-color-scheme: dark) {
.ema__card {
background: #17141a;
}
.ema__title {
color: #fff7e6;
}
.ema__body, .ema__footer {
color: rgba(255, 247, 230, 0.6);
}
.ema__brand {
color: rgba(255, 247, 230, 0.7);
}
.ema__detailtoggle, .ema__li {
color: rgba(255, 247, 230, 0.72);
}
}
.ema-darktoggle {
position: absolute;
top: 8px;
right: 8px;
background: #17141a;
border: 1px solid rgba(255, 247, 230, 0.3);
color: #fff7e6;
border-radius: 999px;
padding: 4px 12px;
font-weight: 600;
font-size: 9px;
line-height: 1.4;
font-family: inherit;
cursor: pointer;
font-family: inherit;
}
.ema__badge {
position: relative;
overflow: hidden;
}
.ema.is-demo .ema__badge::after {
content: "";
position: absolute;
inset: 0;
border-radius: 50%;
background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
transform: translateX(-120%);
}
.ema.is-demo .ema__badge::after {
animation: ema-sweep 2s linear infinite;
}
@keyframes ema-sweep {
0% {
transform: translateX(-120%);
}
90%, 100% {
transform: translateX(120%);
}
}
.ema__detailrow {
padding-top: 0 !important;
}
.ema__detailtoggle {
width: 100%;
text-align: left;
background: none;
border: none;
cursor: pointer;
font-weight: 600;
font-size: 12px;
line-height: 1.4;
font-family: inherit;
color: rgba(23, 20, 26, 0.72);
padding: 4px 0;
}
.ema__detail {
display: grid;
grid-template-rows: 0fr;
transition: grid-template-rows 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.ema__detailin {
overflow: hidden;
}
.ema.is-open .ema__detail {
grid-template-rows: 1fr;
}
.ema__li {
display: flex;
justify-content: space-between;
font-weight: 500;
font-size: 11px;
line-height: 1.6;
font-family: inherit;
color: rgba(23, 20, 26, 0.72);
padding: 4px 0;
border-top: 1px solid rgba(0, 0, 0, 0.06);
}
@media (max-width: 340px), (max-height: 220px) {
.ema__card td {
padding-left: 12px;
padding-right: 12px;
padding-top: 0;
padding-bottom: 0;
}
.ema__brand {
padding-top: 0 !important;
font-size: 9px !important;
}
.ema__hero {
padding-top: 0 !important;
padding-bottom: 0 !important;
}
.ema__badge {
width: 22px;
height: 22px;
font-size: 11px;
}
.ema__title {
font-size: 10px !important;
padding-top: 0 !important;
padding-bottom: 0 !important;
}
.ema__body {
font-size: 8px !important;
padding-bottom: 0 !important;
}
.ema__ctawrap {
padding-top: 0 !important;
padding-bottom: 0 !important;
}
.ema__cta {
padding: 0 20px !important;
}
.ema__footer {
font-size: 7px !important;
padding-top: 4px !important;
padding-bottom: 4px !important;
}
.ema-darktoggle {
font-size: 8px;
padding: 0 8px;
top: 4px;
right: 4px;
}
.ema__detailtoggle, .ema__countdown, .ema__unreadrow, .ema__amount, .ema__copyrow, .ema__steprow {
padding-top: 0 !important;
padding-bottom: 0 !important;
font-size: 9px !important;
}
.ema__li {
padding: 0 12px !important;
font-size: 9px !important;
}
.ema__track {
margin-bottom: 0 !important;
}
.ema__copybtn {
padding: 0 8px !important;
}
}
@media (prefers-reduced-motion: reduce) {
.ema.is-demo .ema__badge,
.ema.is-demo .ema__fill,
.ema.is-demo .ema__badge::after {
animation: none !important;
}
.ema__detail, .ema__card, .ema__cta {
transition: none;
}
}var ema = document.getElementById('ema');
var cta = document.getElementById('cta');
var darktoggle = document.getElementById('darktoggle');
darktoggle.addEventListener('click', function () {
var on = ema.classList.toggle('is-dark');
darktoggle.setAttribute('aria-pressed', String(on));
});
var dt = document.getElementById('detailtoggle');
dt.addEventListener('click', function () {
ema.classList.remove('is-demo');
var open = ema.classList.toggle('is-open');
dt.setAttribute('aria-expanded', String(open));
});import { useState, useEffect, useRef } from "react";
import styles from "./Receipt.module.scss";
export type ReceiptProps = { duration?: number; easing?: string; color?: string };
export default function Receipt({ duration = 300, easing = "cubic-bezier(.2,.8,.2,1)", color = "#2f6df6" }: ReceiptProps) {
const [dark, setDark] = useState(false);
const [open, setOpen] = useState(false);
return (
<main className={styles.stage} style={{ background: "#ffd23f" }}>
<div className={`${styles.ema}`}>
<div className={`${styles.card} ${dark ? styles.dark : ""}`}>
<div className={styles.row + " " + styles.brand}>◆ Acme</div>
<div className={styles.hero}>
<span className={`${styles.badge} ${styles.anim}`} style={{ background: "#2f6df6", animationName: "flash", animationDuration: "2s", animationTimingFunction: "linear", animationIterationCount: "infinite" }} aria-hidden="true">🧾</span>
</div>
<div className={styles.title}>주문이 확인됐어요</div>
<div className={styles.body}>주문번호 #48213 결제가 완료됐어요.<br/>아래에서 영수증을 확인하세요.</div>
<div className={styles.ctawrap}>
<a href="#" role="button" className={styles.cta} style={{ background: "#2f6df6" }} onClick={(e: { preventDefault: () => void }) => { e.preventDefault(); }}>{"영수증 보기"}</a>
</div>
<div className={styles.row}>
<button type="button" className={styles.detailtoggle} aria-expanded={open} onClick={() => setOpen((v) => !v)}>주문 내역 2건 · 총 32,800원</button>
<div className={`${styles.detail} ${open ? styles.open : ""}`}><div className={styles.detailin}>
<div className={styles.li}><span>기본 티셔츠 · 1개</span><span>18,900원</span></div>
<div className={styles.li}><span>양말 세트 · 1개</span><span>13,900원</span></div>
</div></div>
</div>
<div className={styles.footer}>Acme Inc · 서울 · <a href="#">수신거부</a></div>
</div>
<button type="button" className={styles.darktoggle} aria-pressed={dark} onClick={() => setDark((v) => !v)}>다크 모드 미리보기</button>
</div>
</main>
);
}02 Receipt / order confirmation email — Measured area 0.637% · moving frames 16/23Original by GODRICH · SCSS and React ship in the zip · 9 Transactional Email Templates You Can Copy-Paste
The post this demo lives in
9 Transactional Email Templates You Can Copy-PasteTransactional email templates are the emails a product sends automatically — a welcome note, a receipt, a reset link. Th See all demos in this post


