Back to CSS Pricing Sections Monthly Yearly Toggle Pure CSS
Share
.ps-tog {
  padding: clamp(28px, 5vw, 56px) clamp(20px, 4vw, 40px);
  min-height: 480px;
  background: #062021;
  color: #e0fafa;
  font-family: 'Inter', system-ui, sans-serif;
}
.ps-tog-head { text-align: center; margin-bottom: clamp(24px, 4vw, 40px); }
.ps-tog-head h2 {
  font-size: clamp(22px, 3.4vw, 34px); font-weight: 700;
  letter-spacing: -0.02em; margin: 0 0 8px;
  background: linear-gradient(90deg, #14b8a6, #5eead4);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ps-tog-head p { color: #7ea7a4; margin: 0 0 22px; font-size: 14px; }
.ps-tog-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.ps-tog-switch {
  position: relative; display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 0; padding: 4px;
  background: #0d2f30;
  border: 1px solid rgba(94,234,212,0.18);
  border-radius: 999px;
  margin: 0;
}
.ps-tog-switch input[type="radio"] {
  position: absolute; opacity: 0; pointer-events: none;
}
.ps-tog-switch input:focus-visible + label {
  outline: 2px solid #5eead4; outline-offset: 3px;
}
.ps-tog-switch label {
  position: relative; z-index: 1;
  padding: 8px 22px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: #7ea7a4;
  border-radius: 999px;
  transition: color 0.2s;
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.ps-tog-save {
  font-size: 10px; font-weight: 700;
  background: rgba(94,234,212,0.18); color: #5eead4;
  padding: 2px 6px; border-radius: 6px;
}
.ps-tog-thumb {
  position: absolute; top: 4px; left: 4px;
  width: calc(50% - 4px); height: calc(100% - 8px);
  background: linear-gradient(135deg, #14b8a6, #5eead4);
  border-radius: 999px;
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  z-index: 0;
  box-shadow: 0 4px 14px rgba(20,184,166,0.3);
}
.ps-tog-switch:has(#ps-tog-y:checked) .ps-tog-thumb { transform: translateX(100%); }
.ps-tog-switch:has(#ps-tog-m:checked) label[for="ps-tog-m"],
.ps-tog-switch:has(#ps-tog-y:checked) label[for="ps-tog-y"] { color: #062021; }
.ps-tog-switch:has(#ps-tog-y:checked) .ps-tog-save { background: rgba(6,32,33,0.25); color: #062021; }
.ps-tog-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px; max-width: 980px; margin: 0 auto;
}
.ps-tog-card {
  position: relative;
  background: #0d2f30;
  border: 1px solid rgba(94,234,212,0.15);
  border-radius: 14px;
  padding: 24px 22px 22px;
  display: flex; flex-direction: column;
}
.ps-tog-best { border-color: #5eead4; box-shadow: 0 0 0 1px #5eead4 inset; }
.ps-tog-badge {
  position: absolute; top: -10px; right: 16px;
  background: #5eead4; color: #062021;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 4px 10px;
  border-radius: 6px;
}
.ps-tog-card h3 {
  font-size: 15px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; margin: 0 0 14px; color: #5eead4;
}
.ps-tog-price { display: flex; align-items: baseline; gap: 8px; margin-bottom: 18px; }
.ps-tog-m-amt, .ps-tog-y-amt { font-size: 38px; font-weight: 800; letter-spacing: -0.02em; color: #f0fff7; }
.ps-tog-per { font-size: 13px; color: #7ea7a4; }
.ps-tog:has(#ps-tog-m:checked) .ps-tog-y-amt { display: none; }
.ps-tog:has(#ps-tog-y:checked) .ps-tog-m-amt { display: none; }
.ps-tog-card ul {
  list-style: none; padding: 0; margin: 0 0 22px; flex: 1;
  font-size: 13.5px; line-height: 2; color: #c8eaea;
}
.ps-tog-card ul li::before {
  content: '✓'; color: #5eead4; font-weight: 700;
  display: inline-block; width: 20px;
}
.ps-tog-cta {
  display: block; text-align: center;
  padding: 11px 16px; border-radius: 8px;
  text-decoration: none; font-size: 13.5px; font-weight: 600;
  background: rgba(94,234,212,0.12); color: #5eead4;
  border: 1px solid rgba(94,234,212,0.25);
  transition: background 0.18s, color 0.18s;
}
.ps-tog-cta-pri { background: #5eead4; color: #062021; border-color: #5eead4; }
.ps-tog-cta:hover { background: #5eead4; color: #062021; }
.ps-tog-cta:focus-visible { outline: 2px solid #5eead4; outline-offset: 3px; }
@media (max-width: 820px) {
  .ps-tog-grid { grid-template-columns: 1fr; max-width: 380px; }
}
@media (prefers-reduced-motion: reduce) {
  .ps-tog-thumb { transition: none; }
  .ps-tog-cta { transition: none; }
  .ps-tog-switch label { transition: none; }
}
<section class="ps-tog" aria-label="Pricing">
  <header class="ps-tog-head">
    <h2>Pay how it suits you.</h2>
    <p>Switch billing — no contracts, no negotiation.</p>
    <fieldset class="ps-tog-switch">
      <legend class="ps-tog-sr">Billing cycle</legend>
      <input type="radio" name="ps-tog-cycle" id="ps-tog-m" checked />
      <label for="ps-tog-m">Monthly</label>
      <input type="radio" name="ps-tog-cycle" id="ps-tog-y" />
      <label for="ps-tog-y">Yearly <span class="ps-tog-save">−20%</span></label>
      <span class="ps-tog-thumb" aria-hidden="true"></span>
    </fieldset>
  </header>
  <div class="ps-tog-grid">
    <article class="ps-tog-card">
      <h3>Hobby</h3>
      <div class="ps-tog-price">
        <span class="ps-tog-m-amt">$0</span><span class="ps-tog-y-amt">$0</span
        ><span class="ps-tog-per">forever</span>
      </div>
      <ul>
        <li>1 site</li>
        <li>Public projects</li>
        <li>Community</li>
      </ul>
      <a class="ps-tog-cta" href="#hobby">Start free</a>
    </article>
    <article class="ps-tog-card ps-tog-best">
      <span class="ps-tog-badge">Best value</span>
      <h3>Studio</h3>
      <div class="ps-tog-price">
        <span class="ps-tog-m-amt">$19</span><span class="ps-tog-y-amt">$15</span
        ><span class="ps-tog-per">/ month</span>
      </div>
      <ul>
        <li>Unlimited sites</li>
        <li>Custom domains</li>
        <li>Email support</li>
        <li>Form submissions</li>
      </ul>
      <a class="ps-tog-cta ps-tog-cta-pri" href="#studio">Start trial</a>
    </article>
    <article class="ps-tog-card">
      <h3>Agency</h3>
      <div class="ps-tog-price">
        <span class="ps-tog-m-amt">$59</span><span class="ps-tog-y-amt">$47</span
        ><span class="ps-tog-per">/ month</span>
      </div>
      <ul>
        <li>Everything in Studio</li>
        <li>Client billing</li>
        <li>Workspace switcher</li>
        <li>Priority support</li>
      </ul>
      <a class="ps-tog-cta" href="#agency">Choose Agency</a>
    </article>
  </div>
</section>
Live preview Edit any tab — preview updates live Ready