Skip to content

Pricing table ​

Three plans with a monthly/yearly switch, a highlighted plan, prices, calls to action and feature lists.

Installation ​

bash
npx bootcn add pricing-table
bash
pnpm dlx bootcn add pricing-table
bash
yarn dlx bootcn add pricing-table
bash
bunx --bun bootcn add pricing-table

The CLI also installs the design tokens and these blocks and components: button, badge. It prints the <link> and <script> tags to add to your layout.

Usage ​

Edit the plans, prices and features. Each price is written twice, once in bootcn-pricing__monthly and once in bootcn-pricing__yearly; the billing switch shows one set with CSS (:has()), no JavaScript. In browsers without :has() the monthly prices stay visible.

Point each call to action at your sign-up or checkout page, passing the plan and period your server needs.

Accessibility ​

  • The billing switch is a <fieldset> of two real radio buttons with a (visually hidden) legend, so it works with the keyboard and screen readers.
  • Hidden prices use display: none, so only the selected period is read.
  • Each call to action is described by its plan name (aria-describedby), so "Get started" is announced as "Get started, Starter".
  • The highlighted plan is marked with text ("Most popular"), not only a border.

Dependencies ​

  • Bootstrap 5.3+ CSS.
  • themes/tokens/tokens.css.
  • The button component.
  • The badge component.

Source ​

The exact files the CLI installs (pricing-table@1.0.0). View on GitHub · Report an issue

html
<section class="bootcn-pricing" aria-labelledby="bootcn-pricing-title">
  <div class="bootcn-pricing__header">
    <h2 class="bootcn-pricing__title" id="bootcn-pricing-title">Simple, transparent pricing</h2>
    <p class="bootcn-pricing__lead">Start free. Upgrade when your team grows.</p>
    <fieldset class="bootcn-pricing__billing">
      <legend class="visually-hidden">Billing period</legend>
      <input
        class="btn-check bootcn-pricing__toggle"
        type="radio"
        name="bootcn-pricing-billing"
        id="bootcn-pricing-monthly"
        value="monthly"
        checked
      />
      <label class="bootcn-pricing__period" for="bootcn-pricing-monthly">Monthly</label>
      <input
        class="btn-check bootcn-pricing__toggle"
        type="radio"
        name="bootcn-pricing-billing"
        id="bootcn-pricing-yearly"
        value="yearly"
      />
      <label class="bootcn-pricing__period" for="bootcn-pricing-yearly">Yearly (save 20%)</label>
    </fieldset>
  </div>
  <ul class="bootcn-pricing__plans">
    <li class="bootcn-pricing__plan">
      <h3 class="bootcn-pricing__name" id="bootcn-pricing-starter">Starter</h3>
      <p class="bootcn-pricing__description">For individuals and side projects.</p>
      <p class="bootcn-pricing__price">
        <span class="bootcn-pricing__amount bootcn-pricing__monthly">€0</span>
        <span class="bootcn-pricing__amount bootcn-pricing__yearly">€0</span>
        <span class="bootcn-pricing__unit bootcn-pricing__monthly">per month</span>
        <span class="bootcn-pricing__unit bootcn-pricing__yearly">per month, billed yearly</span>
      </p>
      <a
        class="btn bootcn-button bootcn-button--outline w-100"
        href="#starter"
        aria-describedby="bootcn-pricing-starter"
      >
        Get started
      </a>
      <ul class="bootcn-pricing__list" aria-label="Starter includes">
        <li>
          <svg
            class="bootcn-icon"
            width="16"
            height="16"
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="2"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
            focusable="false"
          >
            <path d="M20 6 9 17l-5-5" />
          </svg>
          1 project
        </li>
        <li>
          <svg
            class="bootcn-icon"
            width="16"
            height="16"
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="2"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
            focusable="false"
          >
            <path d="M20 6 9 17l-5-5" />
          </svg>
          Community support
        </li>
        <li>
          <svg
            class="bootcn-icon"
            width="16"
            height="16"
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="2"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
            focusable="false"
          >
            <path d="M20 6 9 17l-5-5" />
          </svg>
          All components and blocks
        </li>
      </ul>
    </li>
    <li class="bootcn-pricing__plan bootcn-pricing__plan--featured">
      <h3 class="bootcn-pricing__name" id="bootcn-pricing-pro">Pro</h3>
      <span class="badge bootcn-badge bootcn-badge--default bootcn-pricing__badge"
        >Most popular</span
      >
      <p class="bootcn-pricing__description">For freelancers and small teams.</p>
      <p class="bootcn-pricing__price">
        <span class="bootcn-pricing__amount bootcn-pricing__monthly">€19</span>
        <span class="bootcn-pricing__amount bootcn-pricing__yearly">€15</span>
        <span class="bootcn-pricing__unit bootcn-pricing__monthly">per month</span>
        <span class="bootcn-pricing__unit bootcn-pricing__yearly">per month, billed yearly</span>
      </p>
      <a
        class="btn bootcn-button bootcn-button--default w-100"
        href="#pro"
        aria-describedby="bootcn-pricing-pro"
      >
        Start free trial
      </a>
      <ul class="bootcn-pricing__list" aria-label="Pro includes">
        <li>
          <svg
            class="bootcn-icon"
            width="16"
            height="16"
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="2"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
            focusable="false"
          >
            <path d="M20 6 9 17l-5-5" />
          </svg>
          Unlimited projects
        </li>
        <li>
          <svg
            class="bootcn-icon"
            width="16"
            height="16"
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="2"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
            focusable="false"
          >
            <path d="M20 6 9 17l-5-5" />
          </svg>
          Email support
        </li>
        <li>
          <svg
            class="bootcn-icon"
            width="16"
            height="16"
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="2"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
            focusable="false"
          >
            <path d="M20 6 9 17l-5-5" />
          </svg>
          Premium templates
        </li>
        <li>
          <svg
            class="bootcn-icon"
            width="16"
            height="16"
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="2"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
            focusable="false"
          >
            <path d="M20 6 9 17l-5-5" />
          </svg>
          Early access to new blocks
        </li>
      </ul>
    </li>
    <li class="bootcn-pricing__plan">
      <h3 class="bootcn-pricing__name" id="bootcn-pricing-team">Team</h3>
      <p class="bootcn-pricing__description">For companies with several products.</p>
      <p class="bootcn-pricing__price">
        <span class="bootcn-pricing__amount bootcn-pricing__monthly">€49</span>
        <span class="bootcn-pricing__amount bootcn-pricing__yearly">€39</span>
        <span class="bootcn-pricing__unit bootcn-pricing__monthly">per month</span>
        <span class="bootcn-pricing__unit bootcn-pricing__yearly">per month, billed yearly</span>
      </p>
      <a
        class="btn bootcn-button bootcn-button--outline w-100"
        href="#team"
        aria-describedby="bootcn-pricing-team"
      >
        Contact sales
      </a>
      <ul class="bootcn-pricing__list" aria-label="Team includes">
        <li>
          <svg
            class="bootcn-icon"
            width="16"
            height="16"
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="2"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
            focusable="false"
          >
            <path d="M20 6 9 17l-5-5" />
          </svg>
          Everything in Pro
        </li>
        <li>
          <svg
            class="bootcn-icon"
            width="16"
            height="16"
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="2"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
            focusable="false"
          >
            <path d="M20 6 9 17l-5-5" />
          </svg>
          Up to 20 seats
        </li>
        <li>
          <svg
            class="bootcn-icon"
            width="16"
            height="16"
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="2"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
            focusable="false"
          >
            <path d="M20 6 9 17l-5-5" />
          </svg>
          Shared design tokens
        </li>
        <li>
          <svg
            class="bootcn-icon"
            width="16"
            height="16"
            viewBox="0 0 24 24"
            fill="none"
            stroke="currentColor"
            stroke-width="2"
            stroke-linecap="round"
            stroke-linejoin="round"
            aria-hidden="true"
            focusable="false"
          >
            <path d="M20 6 9 17l-5-5" />
          </svg>
          Priority support
        </li>
      </ul>
    </li>
  </ul>
</section>
css
.bootcn-pricing__header {
  max-width: 40rem;
  margin: 0 auto 3rem;
  text-align: center;
}

.bootcn-pricing__eyebrow {
  margin: 0 0 0.5rem;
  color: var(--bootcn-muted-foreground);
  font-size: 0.875rem;
  font-weight: 600;
}

.bootcn-pricing__title {
  margin: 0;
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

@media (min-width: 768px) {
  .bootcn-pricing__title {
    font-size: 2.25rem;
  }
}

.bootcn-pricing__lead {
  margin: 1rem 0 0;
  color: var(--bootcn-muted-foreground);
  font-size: 1.125rem;
  line-height: 1.75rem;
}

.bootcn-pricing {
  padding: 4rem 0;
}

/* Billing switch: two radio buttons styled as a segmented control. */
.bootcn-pricing__billing {
  display: inline-flex;
  gap: 0.25rem;
  margin: 1.5rem 0 0;
  padding: 0.25rem;
  border: 0;
  border-radius: var(--bootcn-radius-lg);
  background-color: var(--bootcn-muted);
}

.bootcn-pricing__period {
  padding: 0.25rem 0.75rem;
  border-radius: var(--bootcn-radius);
  color: var(--bootcn-muted-foreground);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.bootcn-pricing__toggle:checked + .bootcn-pricing__period {
  background-color: var(--bootcn-background);
  color: var(--bootcn-foreground);
  box-shadow: var(--bootcn-shadow-sm);
}

.bootcn-pricing__toggle:focus-visible + .bootcn-pricing__period {
  box-shadow: var(--bootcn-focus-ring);
}

/* Show one set of prices. Without :has() support, monthly prices stay. */
.bootcn-pricing .bootcn-pricing__yearly {
  display: none;
}

.bootcn-pricing:has(.bootcn-pricing__toggle[value='yearly']:checked) .bootcn-pricing__monthly {
  display: none;
}

.bootcn-pricing:has(.bootcn-pricing__toggle[value='yearly']:checked) .bootcn-pricing__yearly {
  display: inline;
}

.bootcn-pricing__plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1.5rem;
  align-items: start;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bootcn-pricing__plan {
  display: flex;
  position: relative;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  border: var(--bootcn-border-width) solid var(--bootcn-border-color);
  border-radius: var(--bootcn-radius-xl);
  background-color: var(--bootcn-background);
  box-shadow: var(--bootcn-shadow-sm);
}

.bootcn-pricing__plan--featured {
  border-color: var(--bootcn-primary);
  box-shadow:
    0 0 0 1px var(--bootcn-primary),
    var(--bootcn-shadow-md);
}

.bootcn-pricing__name {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.bootcn-pricing__badge {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
}

.bootcn-pricing__description {
  margin: -0.5rem 0 0;
  color: var(--bootcn-muted-foreground);
  font-size: 0.875rem;
}

.bootcn-pricing__price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.375rem;
  margin: 0;
}

.bootcn-pricing__amount {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.bootcn-pricing__unit {
  color: var(--bootcn-muted-foreground);
  font-size: 0.875rem;
}

.bootcn-pricing__list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

.bootcn-pricing__list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.bootcn-pricing__list .bootcn-icon {
  flex: none;
  margin-top: 0.1875rem;
}

Released under the MIT License. Not affiliated with Bootstrap or shadcn/ui.