JSFiddle - React, Tailwind, and code Playground

by Kheema Pandey

HTML

<p>
          <input type="checkbox" id="c1" name="cb">
          <label for="c1">Option 01</label>
        </p>
        <p>
          <input type="checkbox" id="c2" name="cb">
              
        </p>
        <p>
          <input type="checkbox" id="c3" name="cb">
          <label for="c3">Option 03</label>
        </p>

CSS

input[type="checkbox"] + label {
background-color: #fafafa;
	border: 1px solid #cacece;
	box-shadow: 0 1px 2px rgba(0,0,0,0.05), inset 0px -15px 10px -12px rgba(0,0,0,0.05);
	padding: 9px;
	border-radius: 3px;
	display: inline-block;
    position: relative;
}


input[type="checkbox"] {
    float:left;
    width: 0px;
    opacity: 0;
    height: 0px;
}
label {
  cursor: pointer;
}
input[type="checkbox"] + label:before {
  border: 1px solid #ffffff;
  content: "\2713";
  display: inline-block;
  font: 16px/1em sans-serif;
  height: 16px;
  margin: 0 .25em 0 0;
  padding:0;
  vertical-align: top;
  width: 16px;
}
input[type="checkbox"]:checked + label:before {
  background: #fff;
  color: #red;
  content: "\00a0";
  text-align: center;
}
input[type="checkbox"]:checked + label:after {
  font-weight: bold;
}