JSFiddle - React, Tailwind, and code Playground

Pricing Tables

by Jennifer Perrin

HTML

<div class="cd-pricing-container">
    <div class="cd-pricing-switcher">
        <p class="fieldset">
            <input type="radio" name="duration-1" value="monthly" id="monthly-1" checked />
            <label for="monthly-1">Monthly</label>
            <input type="radio" name="duration-1" value="yearly" id="yearly-1" />
            <label for="yearly-1">Yearly</label>
            <span class="cd-switch"></span>
        </p>
    </div>
            
    <ul class="cd-pricing-list cd-bounce-invert">
        <li>
            <ul class="cd-pricing-wrapper">
                <li data-type="monthly" class="is-visible">
                    <header class="cd-pricing-header">
                        <h2>Basic</h2>
                        
                        <div class="cd-price">
                            <span class="cd-currency">$</span>
                            <span class="cd-value">30</span>
                            <span class="cd-duration">mo</span>
                        </div>
                    </header> <!-- .cd-pricing-header -->
                    
                    <div class="cd-pricing-body">
                        <ul class="cd-pricing-features">
                            <li><em>256MB</em> Memory</li>
                            <li><em>1</em> User</li>
                            <li><em>1</em> Website</li>
                            <li><em>1</em> Domain</li>
                            <li><em>Unlimited</em> Bandwidth</li>
                            <li><em>24/7</em> Support</li>
                        </ul>
                    </div> <!-- .cd-pricing-body -->
                    
                    <footer class="cd-pricing-footer">
                        <a class="cd-select" href="#">Select</a>
                    </footer> <!-- .cd-pricing-footer -->
                </li>
                
                <li data-type="yearly" class="is-hidden">
                    <header class="cd-pricing-header">
                    ...

CSS

html, p, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 100%;
	font: inherit;
	vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, menu, nav, section, main {
	display: block;
}
body {
	line-height: 1;
}
ol, ul {
	list-style: none;
}
blockquote, q {
	quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
	content: '';
	content: none;
}
table {
	border-collapse: collapse;
	border-spacing: 0;
}
/* -------------------------------- 

Primary style

-------------------------------- */
*, *::after, *::before {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

html {
  font-size: 62.5%;
}

html * {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-size: 1.6rem;
  font-family: "Open Sans", sans-serif;
  color: #173d50;
  background-color: #173d50;
}

a {
  color: #e97d68;
  text-decoration: none;
}

/* -------------------------------- 

Main Components 

-------------------------------- */
.cd-pricing-container {
  width: 90%;
  max-width: 1170px;
  margin: 2em auto;
}
@media only screen and (min-width: 768px) {
  .cd-pricing-container {
    margin: 2em auto;
  }
  .cd-pricing-container.cd-full-width {
    width: 100%;
    max-width: none;
  }
}

.cd-pricing-switcher {
  text-align: center;
}
.cd-pricing-switcher .fieldset {
  display: inline-block;
  position: relative;
  padding: 2px;
 ...

JavaScript

/* Modernizr 2.8.3 (Custom Build) | MIT & BSD
 * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load
 */
;window.Modernizr=function(a,b,c){function C(a){j.cssText=a}function D(a,b){return C(n.join(a+";")+(b||""))}function E(a,b){return typeof a===b}function F(a,b){return!!~(""+a).indexOf(b)}function G(a,b){for(var d in a){var e=a[d];if(!F(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function H(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:E(f,"function")?f.bind(d||b):f}return!1}function I(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+p.join(d+" ")+d).split(" ");return E(b,"string")||E(b,"undefined")?G(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),H(e,b,c))}function J(){e.input=function(c){for(var d=0,e=c.length;d<e;d++)u[c[d]]=c[d]in k;return u.list&&(u.list=!!b.createElement("datalist")&&!!a.HTMLDataListElement),u}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var...