npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

awesome-bootstrap-checkbox

v2.0.1

Published

Font Awesome Bootstrap Checkboxes & Radios. Pure css way to make inputs look prettier.

Downloads

44,964

Readme

Awesome Bootstrap Checkbox

NPM version NPM downloads Dependency Status

Font Awesome Bootstrap Checkboxes & Radios plugin. Pure CSS way to make inputs look prettier. No Javascript!

Now with Bootstrap 4 support!

Demo

Use

First just include awesome-bootstrap-checkbox.css somewhere in your HTML, or add the equivalent files to your Sass configuration. Next, everything is based on code convention. Here is checkbox markup from Bootstrap site:

<form role="form">
  ...
  <div class="form-check">
    <label class="form-check-label">
      <input class="form-check-input" type="checkbox">
      Check me out
    </label>
  </div>
  ...
</form>

We have to alter it a bit:

<form role="form">
  ...
  <div class="form-check abc-checkbox">
    <input class="form-check-input" id="checkbox1" type="checkbox">
    <label class="form-check-label" for="checkbox1">
      Check me out
    </label>
  </div>
  ...
</form>

That's it. It will work. But it will not work if you nest input inside label or put label before input.

Browser support

  • Firefox (3.6+)
  • Chrome (14+)
  • IE (9+)
  • Opera (11.6+)
  • Safari (6+)

Radios

It's the same for radios. Markup has to be the following:

<form role="form">
  ...
  <div class="form-check abc-radio">
    <input class="form-check-input" type="radio" name="radio1" id="radio1" value="option1" checked>
    <label class="form-check-label" for="radio1">
      One
    </label>
  </div>
  <div class="form-check abc-radio">
    <input class="form-check-input" type="radio" name="radio1" id="radio2" value="option2">
    <label class="form-check-label" for="radio2">
      Two
    </label>
  </div>
  ...
</form>

Brand Colors and other features

You may use abc-checkbox-primary, abc-checkbox-danger, abc-radio-info, etc to style checkboxes and radios with brand bootstrap colors.

abc-checkbox-circle is for rounded checkboxes.

Inputs without label text:

<div class="form-check abc-checkbox">
  <input class="form-check-input" type="checkbox" id="singleCheckbox" value="option1" aria-label="Single checkbox One">
  <label class="form-check-label" for="singleCheckbox"></label>
</div>

Using Sass

As per example in the demo folder, to use Awesome Bootstrap Checkbox you'll have to @import the following library parts:

@import "../node_modules/bootstrap/scss/functions";
@import "../node_modules/bootstrap/scss/variables";
@import "../node_modules/bootstrap/scss/mixins";

@import "../node_modules/Font-Awesome/scss/variables";

@import "../awesome-bootstrap-checkbox";

Adjust this to the path where your bootstrap and font-awesome files are located.

Custom icon font

If you want to use another icon font instead of Font Awesome, such as Glyphicons, override the default variables:

$font-family-icon: 'Glyphicons Halflings';
$check-icon: "\e013";

.abc-checkbox label:after {
    padding-left: 4px;
    padding-top: 2px;
    font-size: 9px;
}

Or for plain CSS, override the .abc-checkbox class:

.abc-checkbox input[type=checkbox]:checked + label:after {
    font-family: 'Glyphicons Halflings';
    content: "\e013";
}

.abc-checkbox label:after {
    padding-left: 4px;
    padding-top: 2px;
    font-size: 9px;
}

Credits

Based on the Bootstrap and the awesome Font Awesome.