• Stars
    star
    2,042
  • Rank 22,656 (Top 0.5 %)
  • Language
    CSS
  • License
    MIT License
  • Created over 10 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

🤘 Awesome Bootstrap Checkbox

NPM version NPM downloads Dependency Status Join the chat at https://gitter.im/flatlogic/awesome-bootstrap-checkbox

View Demo | Download | More templates | Support forum

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

For Bootstrap 4 version please checkout bump-to-bootstrap4 branch

For Bootstrap 5 version please checkout bump-to-bootstrap5 branch

Check out our React/Vue/Angular/Node.js boilerplates

Flatlogic Templates - 💥Free and open-source application boilerplates built with Bootstrap 5, React, Vue, Angular, Node.js

Use

To install latest version via NPM simply run:

$ npm install awesome-bootstrap-checkbox # for Bootstrap 4 version
$ npm install [email protected] # for Bootstrap 3 version

There is a separate README.md file for Bootstrap 4 version.

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

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

We have to alter it a bit:

<form role="form">
  ...
  <div class="checkbox">
    <input type="checkbox" id="checkbox1">
    <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.

If you want to enable Opera 12 and earlier support just add class styled to input element:

...
<input type="checkbox" id="checkbox1" class="styled">
...

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="radio">
      <input type="radio" name="radio2" id="radio3" value="option1">
      <label for="radio3">
          One
      </label>
  </div>
  <div class="radio">
      <input type="radio" name="radio2" id="radio4" value="option2" checked>
      <label for="radio4">
          Two
      </label>
  </div>
  ...
</form>

Brand Colors and other features

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

checkbox-circle is for rounded checkboxes.

Inputs without label text:

<div class="checkbox">
  <input type="checkbox" class="styled" id="singleCheckbox1" value="option1" aria-label="Single checkbox One">
  <label></label>
</div>

Using Sass

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

@import "../bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/variables";
@import "../bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins";

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

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

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

Using Less

Just like the Sass setup, you'll have to @import the following library parts:

@import "../bower_components/bootstrap/less/variables";
@import "../bower_components/bootstrap/less/mixins";

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

@import "../bower_components/Font-Awesome/less/variables";

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";

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

or for Less:

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

// Same styles as the Sass example...

Or for plain CSS, override the .checkbox class (and .styled class for Opera):

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

input[type="checkbox"].styled:checked label:after,
input[type="radio"].styled:checked label:after,
.checkbox label:after {
    padding-left: 4px;
    padding-top: 2px;
    font-size: 9px;
}

How can I support developers?

  • Star our GitHub repo ⭐
  • Create pull requests, submit bugs, suggest new features or documentation updates 🔧
  • Follow us on Twitter 🐾
  • Like our page on Facebook 👍

Support

For any additional information please go to our support forum and raise your questions or feedback provide there. We highly appreciate your participation!

More from Flatlogic

  • React Native Starter - 🚀 A powerful react native starter template that bootstraps development of your mobile application
  • Sing App Dashboard - 💥 Free and open-source admin dashboard template built with Bootstrap 4
  • React Material Admin - ⚡ Admin boilerplate made with React 17 and Material-UI 5

Credits

Based on the Official Bootstrap Sass port and the awesome Font Awesome.

More Repositories

1

react-native-starter

🚀A powerful react native starter template that bootstraps development of your mobile application
JavaScript
2,047
star
2

react-material-admin

☄️React Material Admin is a React template built with Material-UI
JavaScript
1,535
star
3

react-dashboard

🔥React Dashboard - isomorphic admin dashboard template (React.js, Bootstrap, Node.js, GraphQL, React Router, Babel, Webpack, Browsersync) 🔥
JavaScript
1,526
star
4

angular-material-dashboard

Angular admin dashboard with material design
JavaScript
1,346
star
5

sing-app

💥Free and open-source admin dashboard template built with Bootstrap 4.5 💥
Handlebars
1,267
star
6

sing-app-vue-dashboard

Vue.js admin dashboard template built with Bootstrap 4.5
Vue
681
star
7

light-blue-react-template

Light Blue React Template - Admin Dashboard Template built with React
JavaScript
491
star
8

bootstrap-tabcollapse

Bootstrap Tab Collapse plugin. Switches bootstrap tabs component to collapse for small screens
HTML
371
star
9

light-blue-vue-admin

🤘Vue admin dashboard template with stylish transparent design
Vue
349
star
10

angular-dashboard-seed

Angular dashboard sample application with nodejs REST backend integration
JavaScript
195
star
11

light-blue-dashboard

🔥 Free and open-source admin dashboard template built with Bootstrap
Handlebars
146
star
12

material-vue

💎 Vue Material Template - Vuetify admin dashboard template built with Vuetify and Love 💝
Vue
142
star
13

sofia-react-template

🔮 Sofia React Template - Admin Dashboard Template built with React
JavaScript
142
star
14

one-react-template

Flatlogic One - React Template and Theme
JavaScript
141
star
15

widgster

Small jQuery plugin that provides an easy way to handle basic widget functions like collapsing, closing, ajax-refreshing & fullsreening.
JavaScript
37
star
16

ecommerce-dashboard-react

E-commerce dashboard built with Cube.js and React
JavaScript
26
star
17

one-bootstrap-template

Flatlogic One - Free Bootstrap Template and Theme
Handlebars
25
star
18

dashboard

JavaScript
16
star
19

joulon-demo

JavaScript
2
star
20

cli

Fullstack application generator
TypeScript
2
star
21

app-generator-java

Flatlogic App Generator
Java
1
star