kitbash Sign in Connect agent
Components

One plan pricing

A headline, a quarterly or annual pill toggle with a lime saving tag, and one grey price card with a mono list and a black pill button.

Part of the style

Tile Ring Blackroom

7 parts that belong together, with their tokens, type and rules.

Preview

Code
<style>
/* Goes after the pack's base.css */
@import url("https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400..700&family=Fraunces:ital,opsz,wght@1,9..144,400..600&display=swap");
:root {
  --night: #030110;
  --night-raised: #080519;
  --night-chip: #17152b;
  --white: #f4f4ff;
  --card: #e6e7fd;
  --ink: #030110;
  --ash: #8b8ca3;
  --line: #1e1c32;
  --line-light: #cfcfe6;
  --lime: #8a8ac0;
  --chartreuse: #8888bd;
  --mint: #5c5a78;
  --sky: #8a8ac0;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --font-serif: "Fraunces", Georgia, serif;
  --font-poster: "Fraunces", Georgia, serif;
}
</style>

<section class="pricing">
  <h2 class="pricing__title">One membership.<br>Every packet included.</h2>
  <p class="pricing__note">Save 20% with a yearly plan</p>
  <div class="pricing__toggle" role="group" aria-label="Billing period">
    <button class="pricing__option" type="button" aria-pressed="false" data-price="9" data-per="per quarter">Quarterly</button>
    <button class="pricing__option is-active" type="button" aria-pressed="true" data-price="29" data-per="per year">Yearly <span class="pricing__save">-20%</span></button>
    <span class="pricing__thumb" aria-hidden="true"></span>
  </div>
  <article class="pricing__card">
    <p class="pricing__plan">Grower</p>
    <p class="pricing__price"><span class="pricing__amount">29</span><span class="pricing__currency">€</span> <span class="pricing__per">per year</span></p>
    <ul class="pricing__list">
      <li class="pricing__item">Four packets a season</li>
      <li class="pricing__item">All 212 sowing cards</li>
      <li class="pricing__item">Return sleeves, post paid</li>
      <li class="pricing__item">Members' forum &amp; swap days</li>
    </ul>
    <a class="pricing__button" href="#">Become a member <span class="pricing__arrow" aria-hidden="true"></span></a>
  </article>
</section>

<style>
  .pricing {
    display: grid;
    justify-items: center;
    gap: var(--space-m);
    padding: var(--section-space) var(--edge);
    background: var(--night);
    color: var(--white);
    text-align: center;
  }
  .pricing__title {
    margin: 0;
    font: var(--weight) var(--display-l)/var(--leading-tight) var(--font-display);
    letter-spacing: var(--track-tight);
  }
  .pricing__note {
    margin: 0;
    color: var(--ash);
    font: var(--weight) var(--text-s)/1 var(--font-mono);
    text-transform: uppercase;
  }
  .pricing__toggle {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 4px;
    border-radius: var(--radius-pill);
    background: var(--night-chip);
  }
  .pricing__option {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    min-width: 136px;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--radius-pill);
    background: none;
    color: var(--white);
    font: var(--weight) var(--text-s)/1 var(--font-mono);
    text-transform: uppercase;
    cursor: pointer;
    transition: color var(--medium) ease;
  }
  .pricing__option.is-active { color: var(--ink); }
  .pricing__save {
    padding: 4px 6px;
    border-radius: var(--radius-pill);
    background: var(--lime);
    color: var(--ink);
    font-size: var(--text-xs);
  }
  .pricing__thumb {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: calc(50% - 4px);
    border-radius: var(--radius-pill);
    background: var(--white);
    translate: 100% 0;
    transition: translate var(--medium) var(--ease);
  }
  .pricing__toggle.is-first .pricing__thumb { translate: 0 0; }
  .pricing__card {
    display: grid;
    gap: var(--space-m);
    width: min(100%, 440px);
    margin-top: var(--space-s);
    padding: var(--space-l) var(--space-l) var(--space-m);
    border-radius: var(--radius-l);
    background: var(--card);
    color: var(--ink);
    text-align: left;
  }
  .pricing__plan {
    justify-self: start;
    margin: 0;
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    background: var(--white);
    font: var(--weight) var(--text-xs)/1 var(--font-mono);
    text-transform: uppercase;
  }
  .pricing__price {
    margin: 0;
    font: var(--weight) var(--display-l)/1 var(--font-display);
    letter-spacing: var(--track-tight);
  }
  .pricing__per {
    color: var(--ash);
    font: var(--weight) var(--text-s)/1 var(--font-mono);
    letter-spacing: 0;
    text-transform: uppercase;
  }
  .pricing__list {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: var(--rule) solid var(--line-light);
  }
  .pricing__item {
    display: flex;
    align-items: center;
    gap: var(--space-s);
    padding: 12px 0;
    border-bottom: var(--rule) solid var(--line-light);
    font: var(--weight) var(--text-s)/1.3 var(--font-mono);
    text-transform: uppercase;
  }
  .pricing__item::before {
    content: "";
    width: 6px;
    height: 6px;
    background: var(--lime);
    outline: var(--rule) solid var(--ink);
  }
  .pricing__button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-s);
    min-height: var(--control);
    border-radius: var(--radius-pill);
    background: var(--night);
    color: var(--white);
    font: var(--weight) var(--text-s)/1 var(--font-mono);
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color var(--medium) ease, color var(--medium) ease;
  }
  .pricing__button:hover,
  .pricing__button:focus-visible { background: var(--lime); color: var(--ink); outline: none; }
  .pricing__arrow {
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 7px solid currentColor;
  }

  @media (max-width: 420px) {
    .pricing__option { min-width: 0; padding: 0 12px; }
    .pricing__card { padding: var(--space-m) var(--space-m) var(--space-m); }
  }
</style>

<script>
(() => {
  for (const root of document.querySelectorAll('.pricing')) {
    const toggle = root.querySelector('.pricing__toggle');
    const options = [...root.querySelectorAll('.pricing__option')];
    const amount = root.querySelector('.pricing__amount');
    const per = root.querySelector('.pricing__per');
    options.forEach((option, index) => {
      option.addEventListener('click', () => {
        options.forEach((o) => {
          o.classList.toggle('is-active', o === option);
          o.setAttribute('aria-pressed', String(o === option));
        });
        toggle.classList.toggle('is-first', index === 0);
        amount.textContent = option.dataset.price;
        per.textContent = option.dataset.per;
      });
    });
  }
})();
</script>

Similar components

Plans with meters

Plans with meters

Price and date picker

Price and date picker

Pricing file

Pricing file

Two plans

Two plans

Rates

Rates

Plans

Plans

Three-step tiers

Three-step tiers

Rates list

Rates list