07請求書・サブスク決済メール
0円から始まった請求金額が実際に12,900円まで上がり、ボタンを押すと内訳が開きます。
使いどころ定期課金・サブスク更新の請求書メール
requestAnimationFrametoLocaleStringgrid-template-rows

<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">今月の請求書が届きました</td></tr>
<tr><td align="center" class="ema__body">定期課金の金額が今月の請求書に含まれています。</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">請求書を確認</a></td>
</tr></table>
</td></tr>
<tr><td align="center" class="ema__amount">月額サブスク <b id="amt">0円</b></td></tr><tr><td class="ema__detailrow"><button type="button" class="ema__detailtoggle" id="detailtoggle" aria-expanded="false" aria-controls="detail">請求内訳を見る</button><div class="ema__detail" id="detail"><div class="ema__detailin"><div class="ema__li"><span>Acme Pro 月額</span><span>12,900円</span></div></div></div></td></tr>
<tr><td align="center" class="ema__footer">Acme Inc・ソウル・ <a href="#" class="ema__unsub">配信停止</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">ダークモードプレビュー</button>
</main>@use "../../../../site/static/demo-tokens" as *;
$duration: $dur-base;
$easing: $ease-spring;
$color: $subject-blue;
@include stage($stage-orange);
.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__amount, .ema.is-dark .ema__detailtoggle, .ema.is-dark .ema__li { color: rgba(255,247,230,.72); }
.ema.is-dark .ema__amount b { color: $subject-cream; }
@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__amount, .ema__detailtoggle, .ema__li { color: rgba(255,247,230,.72); }
.ema__amount b { color: $subject-cream; }
}
// 레이아웃 흐름에서 빼 카드 높이에 영향을 주지 않는다 (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.is-demo .ema__badge { animation: ema-counterpulse 2s ease-in-out infinite; }
@keyframes ema-counterpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.ema__amount { font-weight: 600; font-size: 12px; line-height: 1.5;
font-family: inherit; color: rgba($subject-ink, .72); }
.ema__amount b { font-family: "Space Mono", monospace; color: $subject-ink; font-size: 14px; }
.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: #ff4d1f;
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__amount, .ema.is-dark .ema__detailtoggle, .ema.is-dark .ema__li {
color: rgba(255, 247, 230, 0.72);
}
.ema.is-dark .ema__amount b {
color: #fff7e6;
}
@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__amount, .ema__detailtoggle, .ema__li {
color: rgba(255, 247, 230, 0.72);
}
.ema__amount b {
color: #fff7e6;
}
}
.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.is-demo .ema__badge {
animation: ema-counterpulse 2s ease-in-out infinite;
}
@keyframes ema-counterpulse {
0%, 100% {
transform: scale(1);
}
50% {
transform: scale(1.08);
}
}
.ema__amount {
font-weight: 600;
font-size: 12px;
line-height: 1.5;
font-family: inherit;
color: rgba(23, 20, 26, 0.72);
}
.ema__amount b {
font-family: "Space Mono", monospace;
color: #17141a;
font-size: 14px;
}
.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 amt = document.getElementById('amt');
var target = 12900, cur = 0;
var t0 = null;
function step(ts) {
if (!t0) t0 = ts;
var p = Math.min(1, (ts - t0) / 1200);
cur = Math.round(target * p);
amt.textContent = cur.toLocaleString('ko-KR') + '円';
if (p < 1) requestAnimationFrame(step);
}
requestAnimationFrame(step);
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 "./Invoice.module.scss";
export type InvoiceProps = { duration?: number; easing?: string; color?: string };
export default function Invoice({ duration = 300, easing = "cubic-bezier(.2,.8,.2,1)", color = "#2f6df6" }: InvoiceProps) {
const [dark, setDark] = useState(false);
const [open, setOpen] = useState(false);
const [amt, setAmt] = useState(0);
const raf = useRef<number | null>(null);
useEffect(() => {
const t0 = performance.now();
const tick = (ts: number) => { const p = Math.min(1, (ts - t0) / 1200); setAmt(Math.round(12900 * p)); if (p < 1) raf.current = requestAnimationFrame(tick); };
raf.current = requestAnimationFrame(tick);
return () => { if (raf.current) cancelAnimationFrame(raf.current); };
}, []);
return (
<main className={styles.stage} style={{ background: "#ff4d1f" }}>
<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: "counterpulse", animationDuration: "2s", animationTimingFunction: "ease-in-out", animationIterationCount: "infinite" }} aria-hidden="true">💳</span>
</div>
<div className={styles.title}>이번 달 청구서가 도착했어요</div>
<div className={styles.body}>정기결제 금액이 이번 달 청구서에 포함되었어요.</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} style={{ textAlign: "center" }}>월 정기결제 <b>{amt.toLocaleString("ko-KR")}원</b></div>
<div className={styles.row}>
<button type="button" className={styles.detailtoggle} aria-expanded={open} onClick={() => setOpen((v) => !v)}>청구 내역 보기</button>
<div className={`${styles.detail} ${open ? styles.open : ""}`}><div className={styles.detailin}>
<div className={styles.li}><span>Acme Pro 월간</span><span>12,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>
);
}07 請求書・サブスク決済メール — 計測 累積面積 1.118% · 動いたフレーム 23/23GODRICH オリジナル · SCSS と React は zip に同梱 · 【コピペOK】メールテンプレート デザイン9選 — ウェルカムから通知まで
このデモが属する記事
【コピペOK】メールテンプレート デザイン9選 — ウェルカムから通知までメールテンプレート デザインは、ニュースレターを一枚きれいに作ることではなく、ウェルカム・領収書・パスワード再設定のようにサービスが自動送信する「取引型」メールを種類ごとに用意することです。9個のうち1つには、請求金額が0円から実際に12, この記事のデモをすべて見る


