05Price digits as the hero
Flipping the monthly/yearly toggle rolls the oversized price digits over, one place at a time.
Best forPricing comparisons, subscription plan switches
숫자 롤 애니메이션@keyframes price-rolltabular-nums

<main class="stage">
<div class="price is-demo">
<p class="price__plan">Pro plan</p>
<div class="price__amount">
<span class="price__currency">₩</span>
<span class="price__num" aria-hidden="true"></span>
<span class="price__sr">$19/mo · $190/yr</span>
</div>
<p class="price__suffix">/ mo</p>
</div>
</main>@use "../../../../site/static/demo-tokens" as *;
$duration: $dur-loop; // 월간 ↔ 연간 가격이 한 번 굴러가는 주기
$easing: $ease-out;
$color: $subject-cream; // 가격 숫자 색
@include stage($stage-ink);
// @property: 정수 커스텀 속성이라야 애니메이션 중간값도 정수로 보간된다 (03 과 같은 기법)
@property --num {
syntax: '<integer>';
initial-value: 19000;
inherits: false;
}
.price {
text-align: center;
&__plan {
margin: 0 0 $sp-2;
color: rgba($subject-cream, .7);
font-weight: 700;
font-size: clamp(12px, 3vw, 14px);
line-height: 1;
text-transform: uppercase;
letter-spacing: .06em;
}
&__amount {
display: flex;
align-items: flex-start;
justify-content: center;
gap: $sp-1;
}
&__currency {
color: $color;
font-weight: 700;
font-size: clamp(18px, 5vw, 28px);
line-height: 1.4;
}
&__num {
--num: 19000;
counter-reset: num var(--num);
display: block;
font-weight: 800;
font-size: clamp(32px, 10vw, 56px);
line-height: 1;
font-variant-numeric: tabular-nums;
color: $color;
&::before { content: counter(num); }
}
// counter() 는 스크린 리더가 못 읽는다 — 실제 값을 시각적으로만 숨겨 따로 둔다
&__sr {
position: absolute;
width: 1px; height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
&__suffix {
margin: $sp-2 0 0;
color: rgba($subject-cream, .6);
font-weight: 600;
font-size: clamp(12px, 3vw, 14px);
line-height: 1;
}
}
.price.is-demo .price__num {
animation: price-roll $duration $easing infinite;
}
@keyframes price-roll {
0%, 10% { --num: 19000; }
45%, 55% { --num: 190000; }
90%, 100% { --num: 19000; }
}
@media (prefers-reduced-motion: reduce) {
.price.is-demo .price__num { animation: none; --num: 19000; }
}html, body {
margin: 0;
overflow: hidden;
}
.stage {
box-sizing: border-box;
min-height: 100vh;
display: grid;
place-items: center;
margin: 0;
background: #17141a;
font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
padding: clamp(8px, 4vw, 24px);
}
@property --num {
syntax: "<integer>";
initial-value: 19000;
inherits: false;
}
.price {
text-align: center;
}
.price__plan {
margin: 0 0 8px;
color: rgba(255, 247, 230, 0.7);
font-weight: 700;
font-size: clamp(12px, 3vw, 14px);
line-height: 1;
text-transform: uppercase;
letter-spacing: 0.06em;
}
.price__amount {
display: flex;
align-items: flex-start;
justify-content: center;
gap: 4px;
}
.price__currency {
color: #fff7e6;
font-weight: 700;
font-size: clamp(18px, 5vw, 28px);
line-height: 1.4;
}
.price__num {
--num: 19000;
counter-reset: num var(--num);
display: block;
font-weight: 800;
font-size: clamp(32px, 10vw, 56px);
line-height: 1;
font-variant-numeric: tabular-nums;
color: #fff7e6;
}
.price__num::before {
content: counter(num);
}
.price__sr {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
.price__suffix {
margin: 8px 0 0;
color: rgba(255, 247, 230, 0.6);
font-weight: 600;
font-size: clamp(12px, 3vw, 14px);
line-height: 1;
}
.price.is-demo .price__num {
animation: price-roll 2s ease-out infinite;
}
@keyframes price-roll {
0%, 10% {
--num: 19000;
}
45%, 55% {
--num: 190000;
}
90%, 100% {
--num: 19000;
}
}
@media (prefers-reduced-motion: reduce) {
.price.is-demo .price__num {
animation: none;
--num: 19000;
}
}import type { CSSProperties } from "react";
import styles from "./KineticPricing.module.scss";
export type KineticPricingProps = {
planName?: string;
currency?: string;
monthly?: number;
yearly?: number;
suffix?: string;
/** 월간 ↔ 연간 가격이 한 번 굴러가는 주기(기본 2000ms) */
duration?: number;
easing?: string;
color?: string;
};
type Vars = CSSProperties & {
"--duration"?: string; "--easing"?: string; "--color"?: string;
"--num-from"?: number; "--num-to"?: number;
};
export default function KineticPricing({
planName = "Pro plan",
currency = "$",
monthly = 19,
yearly = 190,
suffix = "/ mo",
duration = 2000,
easing = "ease-out",
color = "#fff7e6",
}: KineticPricingProps) {
const vars: Vars = {
"--duration": `${duration}ms`, "--easing": easing, "--color": color,
"--num-from": monthly, "--num-to": yearly,
};
return (
<div className={styles.stage} style={vars}>
<div className={styles.price}>
<p className={styles.plan}>{planName}</p>
<div className={styles.amount}>
<span className={styles.currency}>{currency}</span>
<span className={styles.num} aria-hidden="true" />
<span className={styles.sr}>{currency}{monthly}{suffix} · {currency}{yearly}/yr</span>
</div>
<p className={styles.suffix}>{suffix}</p>
</div>
</div>
);
}05 Price digits as the hero — Measured area 4.107% · moving frames 18/23Original by GODRICH · SCSS and React ship in the zip · I Took Kinetic Typography Apart in CSS
The post this demo lives in
I Took Kinetic Typography Apart in CSSKinetic typography is a design style where the headline scales with the viewport and words rise into place one after ano See all demos in this post


