Pricing Plan Switcher
Intermediate
An interactive pricing table with a switcher to toggle between monthly and yearly plans.
Live Preview
Code Implementation
HTML
<div class="pricing-container">
<div class="switcher-wrapper">
<span class="monthly active">Monthly</span>
<label class="switch">
<input type="checkbox" id="plan-switcher">
<span class="slider round"></span>
</label>
<span class="yearly">Yearly</span>
</div>
<div class="pricing-plans">
<div class="plan">
<h3>Basic</h3>
<div class="price-container">
<span class="price" data-monthly="$10" data-yearly="$100">$10</span>
<span class="period">/month</span>
</div>
<ul>
<li><span class="check">β</span>Feature 1</li>
<li><span class="check">β</span>Feature 2</li>
<li><span class="check">β</span>Feature 3</li>
</ul>
<button class="choose-plan">Choose Plan</button>
</div>
<div class="plan featured">
<div class="featured-badge">Most Popular</div>
<h3>Pro</h3>
<div class="price-container">
<span class="price" data-monthly="$20" data-yearly="$200">$20</span>
<span class="period">/month</span>
</div>
<ul>
<li><span class="check">β</span>Feature 1</li>
<li><span class="check">β</span>Feature 2</li>
<li><span class="check">β</span>Feature 3</li>
</ul>
<button class="choose-plan">Choose Plan</button>
</div>
<div class="plan">
<h3>Enterprise</h3>
<div class="price-container">
<span class="price" data-monthly="$30" data-yearly="$300">$30</span>
<span class="period">/month</span>
</div>
<ul>
<li><span class="check">β</span>Feature 1</li>
<li><span class="check">β</span>Feature 2</li>
<li><span class="check">β</span>Feature 3</li>
</ul>
<button class="choose-plan">Choose Plan</button>
</div>
</div>
</div>
Snippet Features
Browser Compatibility
π’
chrome 61+ π
firefox 60+ π΅
safari 10.1+ π¦
edge 16+