CheckBox Font Awesome Tutorial
Font Awesome Checkbox

So, you loaded the whole FontAwesome library, you may as well make use of it! Lets turn those boring checkboxes into awesome ones.

Try it out :

HTML

<div class="chkBox">
    <input type="checkbox" id="chk1" name="chk1"  />
    <label for="chk1"> Item 1</label>
</div>

CSS

.chkBox{
    font-family: 'Font Awesome 5 Free';
    font-size:1.5rem;
    cursor:pointer;
} 
#chk1{
    display:none;
}
    .chkBox input[type='checkbox']+ label:before {
    content: "\f14a";
 }
    .chkBox  input[type='checkbox']:checked + label:before {
     content: "\f0c8";
}

Notes

Font Awesome has lots of icons we can use to turn into checkboxes, using the basic code above just replace the unicode number with the ones below for different looks

Circle Checkbox

Unchecked :

content: "\f111";


Checked :

content: "\f058";
Smile Checkbox

Unchecked:

 content: "\f587";


Checked:

 content: "\f5b8";
Thumbs Checkbox

Unchecked:

content: "\f00d";


Checked:

  content: "\f00c";

Check out the complete list and come up with your own combinations at FontAwesome The above are all free icons, but lots more options for paid FontAwesome users.

Leave a Reply

Your email address will not be published. Required fields are marked *