Pricing Table examples
ส่วนแสดงราคาแบบสามระดับ พร้อมแพ็กเกจแนะนำที่ไฮไลต์ไว้ รายการฟีเจอร์ และปุ่มสลับการชำระเงินแบบรายเดือนหรือรายปี
ส่วนแสดงราคาแบบสามคอลัมน์ พร้อมระดับราคาแนะนำที่ไฮไลต์ไว้ รายการฟีเจอร์ของแต่ละแพ็กเกจ และปุ่มสลับการชำระเงินแบบรายเดือนหรือรายปี จะยุบเหลือคอลัมน์เดียวบนมือถือตามลำดับที่เขียนแพ็กเกจไว้
หนึ่งในตัวเลือกมี billing toggle แบบใช้งานได้จริง ทั้งใน React และ HTML ธรรมดา ส่วนแบบอื่น ๆ เป็นมาร์กอัปแบบสแตติก ซึ่งเป็นสิ่งที่เว็บไซต์ส่วนใหญ่ต้องการจริงๆ
Three-tier pricing table
Starter, Pro, and Enterprise columns with an outlined, badged recommended plan. The recommended plan moves to the top on mobile.
export default function PricingTable() {
return (
<section className="mx-auto max-w-6xl px-4 py-12">
<div className="mb-10 text-center">
<h2 className="text-3xl font-bold text-gray-900">Simple pricing</h2>
<p className="mt-3 text-gray-600">Start free. Upgrade when your team grows.</p>
</div>
<div className="grid gap-6 lg:grid-cols-3">
<div className="relative rounded-xl border border-gray-200 bg-white p-6">
<h3 className="font-semibold text-gray-900">Starter</h3>
<p className="mt-1 text-sm text-gray-600">For side projects.</p>
<p className="mt-4"><span className="text-4xl font-bold text-gray-900">$0</span><span className="text-sm text-gray-600">/month</span></p>
<ul className="mt-6 space-y-3 text-sm text-gray-700">
<li className="flex gap-2"><svg className="h-4 w-4 shrink-0 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span>1 project</span></li>
<li className="flex gap-2"><svg className="h-4 w-4 shrink-0 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span>Community support</span></li>
<li className="flex gap-2"><svg className="h-4 w-4 shrink-0 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span>1 GB storage</span></li>
</ul>
<a href="#" className="mt-8 block rounded-md px-4 py-2 text-center text-sm font-medium border border-gray-300 text-gray-900 hover:bg-gray-50">Start free</a>
</div>
<div className="relative order-first rounded-xl border-2 border-gray-900 bg-white p-6 lg:order-none">
<span className="absolute -top-3 left-6 rounded-full bg-gray-900 px-3 py-1 text-xs font-medium text-white">Most popular</span>
<h3 className="font-semibold text-gray-900">Pro</h3>
<p className="mt-1 text-sm text-gray-600">For growing teams.</p>
<p className="mt-4"><span className="text-4xl font-bold text-gray-900">$24</span><span className="text-sm text-gray-600">/month</span></p>
<ul className="mt-6 space-y-3 text-sm text-gray-700">
<li className="flex gap-2"><svg className="h-4 w-4 shrink-0 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span>Unlimited projects</span></li>
<li className="flex gap-2"><svg className="h-4 w-4 shrink-0 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span>Priority support</span></li>
<li className="flex gap-2"><svg className="h-4 w-4 shrink-0 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span>100 GB storage</span></li>
</ul>
<a href="#" className="mt-8 block rounded-md px-4 py-2 text-center text-sm font-medium bg-gray-900 text-white hover:bg-gray-700">Start trial</a>
</div>
<div className="relative rounded-xl border border-gray-200 bg-white p-6">
<h3 className="font-semibold text-gray-900">Enterprise</h3>
<p className="mt-1 text-sm text-gray-600">For larger organizations.</p>
<p className="mt-4"><span className="text-4xl font-bold text-gray-900">Custom</span></p>
<ul className="mt-6 space-y-3 text-sm text-gray-700">
<li className="flex gap-2"><svg className="h-4 w-4 shrink-0 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span>SSO and audit logs</span></li>
<li className="flex gap-2"><svg className="h-4 w-4 shrink-0 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span>Dedicated support</span></li>
<li className="flex gap-2"><svg className="h-4 w-4 shrink-0 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span>Custom contracts</span></li>
</ul>
<a href="#" className="mt-8 block rounded-md px-4 py-2 text-center text-sm font-medium border border-gray-300 text-gray-900 hover:bg-gray-50">Contact sales</a>
</div>
</div>
</section>
);
}Pricing table with monthly and annual toggle
The same three tiers with a billing switch that updates prices in place. Buttons carry aria-pressed so the active period is announced.
"use client";
import { useState } from "react";
const plans = [
{
name: "Starter",
tagline: "For side projects.",
monthly: 0,
annual: 0,
features: ["1 project", "Community support", "1 GB storage"],
cta: "Start free",
featured: false,
},
{
name: "Pro",
tagline: "For growing teams.",
monthly: 24,
annual: 19,
features: ["Unlimited projects", "Priority support", "100 GB storage"],
cta: "Start trial",
featured: true,
},
{
name: "Enterprise",
tagline: "For larger organizations.",
monthly: null,
annual: null,
features: ["SSO and audit logs", "Dedicated support", "Custom contracts"],
cta: "Contact sales",
featured: false,
},
];
export default function PricingTable() {
const [annual, setAnnual] = useState(false);
const tab = "rounded-md px-4 py-1.5 text-sm font-medium ";
return (
<section className="mx-auto max-w-6xl px-4 py-12">
<div className="mb-10 text-center">
<h2 className="text-3xl font-bold text-gray-900">Simple pricing</h2>
<p className="mt-3 text-gray-600">Start free. Upgrade when your team grows.</p>
<div
className="mt-6 inline-flex rounded-lg border border-gray-200 p-1"
role="group"
aria-label="Billing period"
>
<button
type="button"
onClick={() => setAnnual(false)}
aria-pressed={!annual}
className={tab + (!annual ? "bg-gray-900 text-white" : "text-gray-600")}
>
Monthly
</button>
<button
type="button"
onClick={() => setAnnual(true)}
aria-pressed={annual}
className={tab + (annual ? "bg-gray-900 text-white" : "text-gray-600")}
>
Annual
</button>
</div>
</div>
<div className="grid gap-6 lg:grid-cols-3">
{plans.map((plan) => {
const price = annual ? plan.annual : plan.monthly;
return (
<div
key={plan.name}
className={
"relative rounded-xl bg-white p-6 " +
(plan.featured
? "order-first border-2 border-gray-900 lg:order-none"
: "border border-gray-200")
}
>
{plan.featured && (
<span className="absolute -top-3 left-6 rounded-full bg-gray-900 px-3 py-1 text-xs font-medium text-white">
Most popular
</span>
)}
<h3 className="font-semibold text-gray-900">{plan.name}</h3>
<p className="mt-1 text-sm text-gray-600">{plan.tagline}</p>
<p className="mt-4">
<span className="text-4xl font-bold text-gray-900">
{price === null ? "Custom" : "$" + price}
</span>
{price !== null && <span className="text-sm text-gray-600">/month</span>}
</p>
<ul className="mt-6 space-y-3 text-sm text-gray-700">
{plan.features.map((feature) => (
<li key={feature}>{feature}</li>
))}
</ul>
<a
href="#"
className={
"mt-8 block rounded-md px-4 py-2 text-center text-sm font-medium " +
(plan.featured
? "bg-gray-900 text-white hover:bg-gray-700"
: "border border-gray-300 text-gray-900 hover:bg-gray-50")
}
>
{plan.cta}
</a>
</div>
);
})}
</div>
</section>
);
}Two-tier pricing table
Free next to paid. Fewer options convert better when the plans are genuinely different rather than incrementally larger.
export default function TwoTierPricing() {
return (
<section className="mx-auto max-w-3xl px-4 py-12">
<div className="mb-10 text-center">
<h2 className="text-3xl font-bold text-gray-900">Two plans. No surprises.</h2>
<p className="mt-3 text-gray-600">Try it free, then pay only when you need more.</p>
</div>
<div className="grid gap-6 md:grid-cols-2">
<div className="relative rounded-xl border border-gray-200 bg-white p-6">
<h3 className="font-semibold text-gray-900">Starter</h3>
<p className="mt-1 text-sm text-gray-600">For side projects.</p>
<p className="mt-4"><span className="text-4xl font-bold text-gray-900">$0</span><span className="text-sm text-gray-600">/month</span></p>
<ul className="mt-6 space-y-3 text-sm text-gray-700">
<li className="flex gap-2"><svg className="h-4 w-4 shrink-0 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span>1 project</span></li>
<li className="flex gap-2"><svg className="h-4 w-4 shrink-0 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span>Community support</span></li>
<li className="flex gap-2"><svg className="h-4 w-4 shrink-0 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span>1 GB storage</span></li>
</ul>
<a href="#" className="mt-8 block rounded-md px-4 py-2 text-center text-sm font-medium border border-gray-300 text-gray-900 hover:bg-gray-50">Start free</a>
</div>
<div className="relative order-first rounded-xl border-2 border-gray-900 bg-white p-6 lg:order-none">
<span className="absolute -top-3 left-6 rounded-full bg-gray-900 px-3 py-1 text-xs font-medium text-white">Most popular</span>
<h3 className="font-semibold text-gray-900">Pro</h3>
<p className="mt-1 text-sm text-gray-600">For growing teams.</p>
<p className="mt-4"><span className="text-4xl font-bold text-gray-900">$24</span><span className="text-sm text-gray-600">/month</span></p>
<ul className="mt-6 space-y-3 text-sm text-gray-700">
<li className="flex gap-2"><svg className="h-4 w-4 shrink-0 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span>Unlimited projects</span></li>
<li className="flex gap-2"><svg className="h-4 w-4 shrink-0 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span>Priority support</span></li>
<li className="flex gap-2"><svg className="h-4 w-4 shrink-0 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span>100 GB storage</span></li>
</ul>
<a href="#" className="mt-8 block rounded-md px-4 py-2 text-center text-sm font-medium bg-gray-900 text-white hover:bg-gray-700">Start trial</a>
</div>
</div>
</section>
);
}Pricing comparison table
A feature-by-feature table with checks and dashes. Use it when plans share most features and differ in limits. Scrolls sideways on narrow screens.
export default function PricingComparison() {
return (
<section className="mx-auto max-w-4xl px-4 py-12">
<h2 className="text-center text-3xl font-bold text-gray-900">Compare plans</h2>
<div className="mt-8 overflow-x-auto rounded-xl border border-gray-200">
<table className="w-full min-w-[32rem] text-left text-sm">
<thead className="bg-gray-50 text-gray-900">
<tr>
<th scope="col" className="px-4 py-3 font-semibold">Feature</th>
<th scope="col" className="px-4 py-3 text-center font-semibold">Starter</th>
<th scope="col" className="px-4 py-3 text-center font-semibold">Pro</th>
<th scope="col" className="px-4 py-3 text-center font-semibold">Enterprise</th>
</tr>
</thead>
<tbody className="divide-y divide-gray-200 text-gray-700">
<tr>
<th scope="row" className="px-4 py-3 font-medium text-gray-900">Projects</th>
<td className="px-4 py-3 text-center">1</td>
<td className="px-4 py-3 text-center">Unlimited</td>
<td className="px-4 py-3 text-center">Unlimited</td>
</tr>
<tr>
<th scope="row" className="px-4 py-3 font-medium text-gray-900">Storage</th>
<td className="px-4 py-3 text-center">1 GB</td>
<td className="px-4 py-3 text-center">100 GB</td>
<td className="px-4 py-3 text-center">Custom</td>
</tr>
<tr>
<th scope="row" className="px-4 py-3 font-medium text-gray-900">Community support</th>
<td className="px-4 py-3 text-center"><svg className="mx-auto h-5 w-5 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span className="sr-only">Included</span></td>
<td className="px-4 py-3 text-center"><svg className="mx-auto h-5 w-5 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span className="sr-only">Included</span></td>
<td className="px-4 py-3 text-center"><svg className="mx-auto h-5 w-5 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span className="sr-only">Included</span></td>
</tr>
<tr>
<th scope="row" className="px-4 py-3 font-medium text-gray-900">Priority support</th>
<td className="px-4 py-3 text-center"><span aria-hidden="true" className="text-gray-400">-</span><span className="sr-only">Not included</span></td>
<td className="px-4 py-3 text-center"><svg className="mx-auto h-5 w-5 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span className="sr-only">Included</span></td>
<td className="px-4 py-3 text-center"><svg className="mx-auto h-5 w-5 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span className="sr-only">Included</span></td>
</tr>
<tr>
<th scope="row" className="px-4 py-3 font-medium text-gray-900">SSO and audit logs</th>
<td className="px-4 py-3 text-center"><span aria-hidden="true" className="text-gray-400">-</span><span className="sr-only">Not included</span></td>
<td className="px-4 py-3 text-center"><span aria-hidden="true" className="text-gray-400">-</span><span className="sr-only">Not included</span></td>
<td className="px-4 py-3 text-center"><svg className="mx-auto h-5 w-5 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span className="sr-only">Included</span></td>
</tr>
<tr>
<th scope="row" className="px-4 py-3 font-medium text-gray-900">Custom contracts</th>
<td className="px-4 py-3 text-center"><span aria-hidden="true" className="text-gray-400">-</span><span className="sr-only">Not included</span></td>
<td className="px-4 py-3 text-center"><span aria-hidden="true" className="text-gray-400">-</span><span className="sr-only">Not included</span></td>
<td className="px-4 py-3 text-center"><svg className="mx-auto h-5 w-5 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span className="sr-only">Included</span></td>
</tr>
</tbody>
</table>
</div>
</section>
);
}Pricing table with elevated featured plan
The recommended plan is lifted with a shadow and extra height instead of a heavier border, so emphasis comes from depth.
export default function ElevatedPricing() {
return (
<section className="mx-auto max-w-6xl px-4 py-12">
<div className="mb-10 text-center">
<h2 className="text-3xl font-bold text-gray-900">Pricing that scales</h2>
<p className="mt-3 text-gray-600">The Pro plan covers most teams.</p>
</div>
<div className="grid gap-6 lg:grid-cols-3 lg:items-center">
<div className="relative rounded-xl border border-gray-200 bg-white p-6">
<h3 className="font-semibold text-gray-900">Starter</h3>
<p className="mt-1 text-sm text-gray-600">For side projects.</p>
<p className="mt-4"><span className="text-4xl font-bold text-gray-900">$0</span><span className="text-sm text-gray-600">/month</span></p>
<ul className="mt-6 space-y-3 text-sm text-gray-700">
<li className="flex gap-2"><svg className="h-4 w-4 shrink-0 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span>1 project</span></li>
<li className="flex gap-2"><svg className="h-4 w-4 shrink-0 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span>Community support</span></li>
<li className="flex gap-2"><svg className="h-4 w-4 shrink-0 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span>1 GB storage</span></li>
</ul>
<a href="#" className="mt-8 block rounded-md px-4 py-2 text-center text-sm font-medium border border-gray-300 text-gray-900 hover:bg-gray-50">Start free</a>
</div>
<div className="relative order-first rounded-xl bg-white p-6 shadow-xl ring-1 ring-gray-900/10 lg:order-none lg:-my-4 lg:py-10">
<span className="absolute -top-3 left-6 rounded-full bg-gray-900 px-3 py-1 text-xs font-medium text-white">Most popular</span>
<h3 className="font-semibold text-gray-900">Pro</h3>
<p className="mt-1 text-sm text-gray-600">For growing teams.</p>
<p className="mt-4"><span className="text-4xl font-bold text-gray-900">$24</span><span className="text-sm text-gray-600">/month</span></p>
<ul className="mt-6 space-y-3 text-sm text-gray-700">
<li className="flex gap-2"><svg className="h-4 w-4 shrink-0 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span>Unlimited projects</span></li>
<li className="flex gap-2"><svg className="h-4 w-4 shrink-0 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span>Priority support</span></li>
<li className="flex gap-2"><svg className="h-4 w-4 shrink-0 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span>100 GB storage</span></li>
</ul>
<a href="#" className="mt-8 block rounded-md px-4 py-2 text-center text-sm font-medium bg-gray-900 text-white hover:bg-gray-700">Start trial</a>
</div>
<div className="relative rounded-xl border border-gray-200 bg-white p-6">
<h3 className="font-semibold text-gray-900">Enterprise</h3>
<p className="mt-1 text-sm text-gray-600">For larger organizations.</p>
<p className="mt-4"><span className="text-4xl font-bold text-gray-900">Custom</span></p>
<ul className="mt-6 space-y-3 text-sm text-gray-700">
<li className="flex gap-2"><svg className="h-4 w-4 shrink-0 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span>SSO and audit logs</span></li>
<li className="flex gap-2"><svg className="h-4 w-4 shrink-0 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span>Dedicated support</span></li>
<li className="flex gap-2"><svg className="h-4 w-4 shrink-0 text-gray-900" fill="none" stroke="currentColor" strokeWidth="1.5" viewBox="0 0 24 24" aria-hidden="true"><path strokeLinecap="round" strokeLinejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg><span>Custom contracts</span></li>
</ul>
<a href="#" className="mt-8 block rounded-md px-4 py-2 text-center text-sm font-medium border border-gray-300 text-gray-900 hover:bg-gray-50">Contact sales</a>
</div>
</div>
</section>
);
}What is a Pricing Table?
Pricing table จะจัดวางแพ็กเกจของผลิตภัณฑ์ไว้เคียงข้างกันเพื่อให้ผู้เข้าชมเปรียบเทียบได้ในแวบเดียว มันคืออินเทอร์เฟซสำหรับการเปรียบเทียบที่ซ่อนอยู่ภายใต้ส่วนการตลาด โดยหน้าที่เชิงภาพคือทำให้ดูสะอาดตา และหน้าที่จริงคือทำให้เห็นความแตกต่างระหว่างแต่ละระดับได้เร็วพอที่คนจะตัดสินใจเลือกสักอัน แทนที่จะเดินจากไปเพื่อคิดทบทวน
โครงสร้างนี้แทบจะเป็นสากลเพราะมันเวิร์ก แต่ละคอลัมน์ประกอบด้วยชื่อแพ็กเกจ คำโปรยสั้นๆ ว่าเหมาะกับใคร ราคา รายการสิ่งที่รวมอยู่ และปุ่มดำเนินการ โดยปกติมักจะไฮไลต์ระดับที่แนะนำ ซึ่งฟังดูเหมือนลูกเล่นด้านการออกแบบแต่จริงๆ แล้วมันทำหน้าที่สำคัญ เมื่อมีตัวเลือกที่คล้ายกันสามตัวโดยไม่มีคำแนะนำ คนมักจะเลือกอันตรงกลางหรือไม่ก็ไม่เลือกเลย การมีคำแนะนำที่ชัดเจนจึงช่วยตัดความลังเลออกไป
Billing toggle เป็นส่วนเดียวที่มีการโต้ตอบอย่างแท้จริง และมีไว้เพราะราคาแบบรายปีมักจะลดราคา การแสดงตัวเลขเทียบเท่ารายเดือนในราคาลดพิเศษขณะเรียกเก็บเงินรายปีเป็นเรื่องปกติ แต่ควรระบุในป้ายกำกับให้ชัดเจนว่ากำลังเรียกเก็บตัวเลขใดและเมื่อไหร่ เพราะช่องว่างระหว่างตัวเลขที่แสดงกับยอดเงินที่ถูกตัดออกจากบัญชีจริงๆ คือจุดที่หน้าชำระเงินมักจะสูญเสียความน่าเชื่อถือ
จุดที่ส่วนเหล่านี้มักล้มเหลวบ่อยที่สุดคือที่ breakpoint คอลัมน์รายการฟีเจอร์สามคอลัมน์จะกลายเป็นบล็อกเรียงซ้อนกันสามบล็อกบนมือถือ และแพ็กเกจแนะนำที่ถูกจัดวางไว้อย่างดีตรงกลางสำหรับหน้าจอเดสก์ท็อป จะกล the ยไปอยู่แทรกระหว่างอีกสองอัน ซึ่งอยู่ต่ำกว่าจุดพับที่ผู้ืชมมือถือส่วนใหญ่ไม่เลื่อนลงมาดู การจัดลำดับแพ็กเกจให้ตัวที่แนะนำแสดงขึ้นมาก่อนบนมือถือเป็นการแก้ไขแบบใช้คลาสเดียวที่ทำได้ง่ายแต่ถ้าพลาดจะเสียหายมาก
Anatomy
- Section heading
- หัวข้อและบรรทัดเสริมเหนือคอลัมน์ ควรกำหนดให้บรรทัดเสริมมีความยาวเพียงหนึ่งประโยคเกี่ยวกับกลุ่มเป้าหมายของแพ็กเกจ ไม่ใช่ประโยคขายของ
- Billing toggle
- ปุ่มสองปุ่มที่ใส่ aria-pressed เพื่อระบุว่าช่วงเวลาใดกำลังใช้งานอยู่ ใช้ปุ่มแทนสวิตช์เพราะเป็นการเลือกระหว่างตัวเลือกที่มีชื่อสองตัวเลือก แทนที่จะเป็นการเปิดและปิด
- Plan card
- หนึ่งคอลัมน์ต่อหนึ่งระดับราคา ทำหน้าที่เก็บชื่อ สโลแกน ราคา รายการฟีเจอร์ และปุ่มดำเนินการ การ์ดทั้งหมดใช้ระยะห่างภายในเท่ากันเพื่อให้ราคาและปุ่มเรียงตรงกันข้ามคอลัมน์
- Featured badge
- ป้ายกำกับที่จัดตำแหน่งแบบ absolute บนแพ็กเกจแนะนำ โดยเยื้องขึ้นไปเหนือขอบบนของการ์ดเพื่อให้ดูเหมือนแนบอยู่ด้วยมากกว่าที่จะอยู่ข้างใน
- Feature list
- แท็ก ul หนึ่งอันต่อแพ็กเกจ พยายามรักษาจำนวนรายการให้เท่ากันในแต่ละระดับ มิฉะนั้นคอลัมน์จะมีความสูงไม่เท่ากันและทำให้ปุ่มหลุดแนว
- Plan action
- ปุ่มหรือลิงก์ที่ด้านล่างของการ์ดแต่ละใบ แพ็กเกจแนะนำจะใช้สไตล์ทึบ (solid) ในขณะที่แพ็กเกจอื่นใช้เส้นขอบ (outline) เพื่อให้น้ำหนักทางสายตาสอดคล้องกับเส้นทางที่ต้องการ
How to Use
- 1
Copy the version you need
เลือกเวอร์ชัน React หากคุณต้องการ billing toggle ที่ใช้งานได้จริง หรือเลือกเวอร์ชัน HTML สำหรับตารางแบบสแตติกรายเดือนเท่านั้น
- 2
Edit the plans array
แทนที่ชื่อ สโลแกน ราคา และฟีเจอร์ แฟล็ก featured จะเป็นตัวควบคุมว่าคอลัมน์ใดจะได้ขอบ ป้ายกำกับ และปุ่มทึบ - ให้ตั้งค่านี้กับแพ็กเกจเดียวเท่านั้น
- 3
Set your annual discount
ฟิลด์รายปีคือราคาเทียบเท่ารายเดือนเมื่อเรียกเก็บเงินเป็นรายปี ไม่ใช่ยอดรวมรายปี โปรดระบุป้ายกำกับให้ชัดเจนว่าเรียกเก็บเงินจากตัวเลขใด
- 4
Fix the mobile order
Add order-first lg:order-none to the featured card so the recommended plan appears at the top on phones and back in the middle on desktop.
- 5
เชื่อมต่อการทำงานของปุ่ม action ต่างๆ
Point each plan's link at your signup flow with the plan identifier in the query string or path, so the selection carries through instead of being asked for again.
Features
ปุ่มสลับการเรียกเก็บเงินที่ใช้งานได้จริง
Monthly and annual prices switch without a page reload, with aria-pressed on each button so the active period is announced rather than only shown.
คอลัมน์ที่ขับเคลื่อนด้วยข้อมูล (Data-driven)
The whole section renders from one plans array, so adding or removing a tier is a data change rather than a markup change.
การเน้นแพ็กเกจเด่น (Featured plan)
A single boolean drives the heavier border, the badge, and the solid button, keeping the emphasis consistent instead of hand-applied per element.
จัดแนวให้ตรงกันทุกคอลัมน์
Shared internal spacing keeps prices, lists, and buttons on the same horizontal lines, which is what makes a table scannable rather than just tidy.
การจัดการราคาแบบกำหนดเอง
A null price renders as Custom with the per-month suffix suppressed, so an enterprise tier does not need its own separate markup.
Common Uses
หน้าตารางราคา SaaS
เลย์เอาต์มาตรฐาน 3 แพ็กเกจสำหรับผลิตภัณฑ์แบบสมัครสมาชิก โดยมีแพ็กเกจฟรีหรือเริ่มต้นเป็นฐานที่ราคาต่ำสุด และแพ็กเกจติดต่อฝ่ายขายอยู่ด้านบนสุด
แพ็กเกจบริการและเอเจนซี
Presenting fixed-scope packages where the differences are deliverables rather than usage limits, with the middle package as the intended default.
ระดับสมาชิกและคอร์สเรียน
Laying out access levels for a community, course, or newsletter where annual billing carries a meaningful discount.
การเปรียบเทียบแพ็กเกจแบบชำระเงินกับแบบฟรี
A two-column version that puts the free tier next to the paid one, making the upgrade case by contrast rather than by argument.
Accessibility
- The billing toggle uses buttons with aria-pressed rather than a checkbox styled as a switch, because the choice is between two named periods and not a binary on or off.
- Plan names are real headings, so a screen reader user can move between plans with heading navigation instead of listening through every feature list.
- Feature lists are ul elements, so their length is announced before the items are read and a listener can decide whether to skip ahead.
- The featured badge is plain text inside the card, so it is read in place rather than being a decorative element that never reaches assistive technology.
- Price changes on toggle happen in the normal document flow. If you need the change announced, wrap the price in a container with aria-live set to polite.
- Each action link carries the plan name in its text or in an aria-label, so a list of links read out of context does not consist of three identical Start trial entries.
Customization
- Change the accent by replacing the gray-900 values on the featured border, badge, and button. Those three should always move together or the emphasis breaks apart.
- Switch to a comparison layout by replacing the per-plan lists with a single table below the cards, which works better when plans share features and differ only in limits.
- Add a savings note next to the annual toggle. Keep it factual - a percentage that matches the actual difference rather than a rounded-up marketing figure.
- Give the featured card elevation with shadow-lg and lg:-mt-4 instead of a heavier border, if outlines are too loud for your design.
- For more than three tiers, move to a horizontally scrollable row on mobile rather than a taller stack, since four stacked cards push the last one far below the fold.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| plans * | Plan[] | - | ระดับราคาที่จะเรนเดอร์ แต่ละระดับประกอบด้วยชื่อ สโลแกน ราคาต่อเดือนและต่อปี รายการฟีเจอร์ และแฟล็ก featured ที่ใช้ควบคุมการไฮไลต์ |
| defaultAnnual | boolean | false | รอบการชำระเงินเริ่มต้นของ toggle การเริ่มด้วยรายปีจะแสดงตัวเลขที่ถูกกว่า ซึ่งบางทีมชอบแต่วิธีอื่นอาจมองว่าทำให้เข้าใจผิดได้ ดังนั้นโปรดเลือกอย่างตั้งใจ |
Why Use These Pricing Tables?
The billing toggle is real working state, not a static screenshot of one. Most copy-paste pricing sections either omit it or leave it as a non-functional decoration that has to be wired up before the page can ship.
The columns render from a data array, so a price change is one edit rather than three parallel edits across near-identical blocks of markup - which is how pricing tables end up inconsistent after a few rounds of updates.
ปัญหาการเรียงลำดับบนมือถือได้รับการบันทึกไว้แทนที่จะปล่อยให้เป็นเรื่องเซอร์ไพรส์ นี่คือข้อบกพร่องที่พบบ่อยที่สุดในส่วนราคา และวิธีแก้คือใช้แค่หนึ่งคลาส Tailwind
Tips
- วางแพ็กเกจที่แนะนำไว้เป็นอันดับแรกบนมือถือด้วย order-first lg:order-none ตำแหน่งตรงกลางช่วยได้เฉพาะบนจอภาพกว้างเท่านั้น เมื่อเรียงซ้อนกัน มันจะกลายเป็นสิ่งที่ถูกเลื่อนผ่านไปเป็นอันดับสอง
- รักษาความยาวของรายการฟีเจอร์ให้เท่ากันทุกแพ็กเกจเท่าที่จะทำได้ รายการที่ไม่เท่ากันจะทำให้ปุ่มอยู่คนละระดับความสูง ซึ่งดูไม่เรียบร้อยแม้ว่าจะไม่มีใครบอกได้ว่าเพราะอะไรก็ตาม
- ขึ้นต้นฟีเจอร์แต่ละรายการด้วยสิ่งที่เปลี่ยนแปลงไประหว่างเทียร์ แทนที่จะเป็นสิ่งที่ทุกเทียร์มีเหมือนกัน สามคอลัมน์ที่เริ่มต้นด้วย SSL certificate เหมือนกันทั้งหมด จะทำให้บรรทัดที่คนอ่านมากที่สุดเสียเปล่า
- ระบุให้ชัดเจนว่าตัวเลขรายปีนั้นเป็นราคาเทียบเท่ารายเดือนหรือยอดรวมทั้งปี นี่คือที่มาที่พบบ่อยที่สุดของความสับสนในหน้าแสดงราคา
- หลีกเลี่ยงการมีเทียร์ที่สี่เว้นแต่ว่าแพ็กเกจจะแตกต่างกันอย่างแท้จริง คอลัมน์ที่เพิ่มเข้ามาแต่ละคอลัมน์จะทำให้คอลัมน์อื่นแคบลง และเพิ่มการตัดสินใจแทนที่จะช่วยลด
- หากแพ็กเกจมีขีดจำกัดการใช้งาน ให้แสดงไว้ในรายการแทนที่จะเป็นเชิงอรรถ ขีดจำกัดที่เพิ่งมารู้ทีหลังตอนสมัครใช้งานแล้วคือคำขอคืนเงินที่รออยู่