コンポーネント研究 / 料金
月額・年額の料金表
支払い周期の切り替えと、おすすめプランの強調表示。
切り替えホバー効果モダンミニマルサンセリフ3カラムカードグリッドレスポンシブSaaSスタートアップ
ライブプレビュー
表示幅: 1440px。画面に合わせて縮小しています。原寸での操作や長いセクションの確認には、プレビューを開いてください。
'use client';
import { useState } from 'react';
const COLORS = {
light: {
background: '#FAFAFA',
heading: '#111111',
subheading: '#555555',
cardBg: '#FFFFFF',
cardBorder: '#E5E5E5',
cardHighlightBorder: '#6C4BEF',
price: '#111111',
period: '#999999',
featureText: '#555555',
featureCheck: '#22C55E',
buttonBg: '#111111',
buttonText: '#FFFFFF',
buttonOutlineBg: 'transparent',
buttonOutlineText: '#111111',
buttonOutlineBorder: '#DDDDDD',
toggleBg: '#E5E5E5',
toggleActive: '#6C4BEF',
toggleText: '#555555',
toggleActiveText: '#FFFFFF',
badge: '#F0EDFF',
badgeText: '#6C4BEF',
},
dark: {
background: '#0A0A0A',
heading: '#FFFFFF',
subheading: '#999999',
cardBg: '#111111',
cardBorder: '#222222',
cardHighlightBorder: '#A78BFA',
price: '#FFFFFF',
period: '#666666',
featureText: '#999999',
featureCheck: '#22C55E',
buttonBg: '#FFFFFF',
buttonText: '#000000',
buttonOutlineBg: 'transparent',
buttonOutlineText: '#FFFFFF',
buttonOutlineBorder: '#333333',
toggleBg: '#1A1A1A',
toggleActive: '#A78BFA',
toggleText: '#666666',
toggleActiveText: '#FFFFFF',
badge: '#1A1535',
badgeText: '#A78BFA',
},
} as const;
interface Plan {
name: string;
monthlyPrice: number;
yearlyPrice: number;
features: string[];
highlighted?: boolean;
cta: string;
}
interface SamplePricing2Props {
mode?: 'light' | 'dark';
title?: string;
subtitle?: string;
plans?: Plan[];
}
const defaultPlans: Plan[] = [
{
name: '스타터',
monthlyPrice: 0,
yearlyPrice: 0,
features: ['프로젝트 3개', '기본 분석', '커뮤니티 지원', '주간 보고서'],
cta: '무료로 시작',
},
{
name: '프로페셔널',
monthlyPrice: 29000,
yearlyPrice: 24000,
features: [
'프로젝트 무제한',
'고급 분석',
'우선 지원',
'실시간 대시보드',
'API 접근',
'팀 협업',
],
highlighted: true,
cta: '14일 무료 체험',
},
{
name: '엔터프라이즈',
monthlyPrice: 99000,
yearlyPrice: 82000,
features: [
'모든 프로 기능',
'전담 매니저',
'SLA 보장',
'맞춤 연동',
'온프레미스 옵션',
'감사 로그',
],
cta: '문의하기',
},
];
export default function SamplePricing2({
mode = 'dark',
title = '합리적인 요금제',
subtitle = '비즈니스 규모에 맞는 요금제를 선택하세요',
plans = defaultPlans,
}: SamplePricing2Props) {
const colors = COLORS[mode];
const [isYearly, setIsYearly] = useState(false);
const formatPrice = (price: number) => (price === 0 ? '무료' : `₩${price.toLocaleString()}`);
return (
<section className="px-6 py-24" style={{ backgroundColor: colors.background }}>
<div className="max-w-6xl mx-auto">
<div className="text-center mb-12">
<h2 className="text-4xl md:text-5xl font-bold" style={{ color: colors.heading }}>
{title}
</h2>
<p className="mt-4 text-lg" style={{ color: colors.subheading }}>
{subtitle}
</p>
<div className="flex items-center justify-center gap-3 mt-8">
<span
className="text-sm"
style={{ color: !isYearly ? colors.heading : colors.toggleText }}
>
월간
</span>
<button
onClick={() => setIsYearly(!isYearly)}
className="relative w-12 h-6 rounded-full transition-colors"
style={{ backgroundColor: isYearly ? colors.toggleActive : colors.toggleBg }}
>
<span
className="absolute top-0.5 w-5 h-5 rounded-full bg-white transition-transform"
style={{ left: isYearly ? '26px' : '2px' }}
/>
</button>
<span
className="text-sm"
style={{ color: isYearly ? colors.heading : colors.toggleText }}
>
연간
<span
className="ml-1 text-xs px-2 py-0.5 rounded-full"
style={{ backgroundColor: colors.badge, color: colors.badgeText }}
>
-17%
</span>
</span>
</div>
</div>
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
{plans.map((plan) => (
<div
key={plan.name}
className="rounded-2xl p-8 flex flex-col"
style={{
backgroundColor: colors.cardBg,
border: `1px solid ${plan.highlighted ? colors.cardHighlightBorder : colors.cardBorder}`,
}}
>
{plan.highlighted && (
<span
className="self-start text-xs font-medium px-3 py-1 rounded-full mb-4"
style={{ backgroundColor: colors.badge, color: colors.badgeText }}
>
추천
</span>
)}
<h3 className="text-xl font-semibold" style={{ color: colors.heading }}>
{plan.name}
</h3>
<div className="mt-4 flex items-baseline gap-1">
<span className="text-4xl font-bold" style={{ color: colors.price }}>
{formatPrice(isYearly ? plan.yearlyPrice : plan.monthlyPrice)}
</span>
{plan.monthlyPrice > 0 && (
<span className="text-sm" style={{ color: colors.period }}>
/월
</span>
)}
</div>
<ul className="mt-8 flex-1 space-y-3">
{plan.features.map((feature) => (
<li
key={feature}
className="flex items-center gap-2 text-sm"
style={{ color: colors.featureText }}
>
<span style={{ color: colors.featureCheck }}>✓</span>
{feature}
</li>
))}
</ul>
<button
className="mt-8 w-full py-3 rounded-lg text-sm font-semibold transition-opacity hover:opacity-90"
style={
plan.highlighted
? { backgroundColor: colors.buttonBg, color: colors.buttonText }
: {
backgroundColor: colors.buttonOutlineBg,
color: colors.buttonOutlineText,
border: `1px solid ${colors.buttonOutlineBorder}`,
}
}
>
{plan.cta}
</button>
</div>
))}
</div>
</div>
</section>
);
}