Tons of Checkboxes
A huge collection of pure css checkboxes. Click Here for Demo
Compatible
- IE9+
- Chrome 49+
- Firefox 52+
- Safari 5+
How to use
- Install via NPM
npm i css-checkbox-library
or Download the Zip - Import the
checkboxes.min.css
orcheckboxes.css
file from thedist
folder. - Use the checkbox design you like with the following markup. In the example below the class
ckbx-square-1
is important.
<div class="ckbx-square-1">
<input type="checkbox" checked id="ckbx-square-1-2" value="0" name="ckbx-square-1">
<label for="ckbx-square-1-2"></label>
</div>
That's it.
You can checkout the DEMO to get HTML Code for each design. Just press the HTML button.
Changelog
1.5.1
- minor updates
1.5.0
- Major changes, Size reduction and refactor thanks to @varunsridharan. (No breaking changes)
[ Major Update ] : Major Refector & Reduced Overall Size
@hunzaboy First of all thanks for the awesome library. :-) I have been using this in my project https://github.com/wponion/wponion for a while And your recent update which provided me with scss files so i worked on it and reduced css output size from combining all common css codes.
| CSS File | Old Size | New Size | | ------------- | ------------ | ------------ | | checkboxes.css | 25.5 KB | 10.6 KB | | checkboxes.min.css | 20.4 KB | 8.72 KB |
Enhacement suggestion
Great library. One problem i had was the need to have a unique id for each of the checkbox. It's easy to do with particular pages, but with a large system can be complicated (when you have custom controls and some other things).
So, trying to not use the id to link the label and the input, i have this solution:
I put a label over all elements (get ridding of the needed id) and an span with .label class to maintain the use of the CSS's. Changing them to:
:checked + .label:after {
Using ".label", not "label"
What do you think about the change?
How to use descriptive text for checkbox?
First of, I love how easy and stylish the checkboxes look, this is definitely better than the default look. However, I am struggling to show text on the right of the checkbox. For example, when using .ckbx-style-13 then the checkbox is overlapping the actual text.
Checkbox doesn't effect if I click the checkbox
I'm making chrome extension, and I'd like to use css-checkbox-library. However, how many times I click, this checkbox doesn't change color.
If table tr tag, checkbox does not effect?
Thank you very much, and sorry unwell English.
Stopped it from interfering with other checkboxes
Altered checkboxes.css to keep it from hiding checkboxes that aren't styled with this library. Without this, any checkboxes would be turned invisible, even if they didn't have the styled CSS switch. Now they are only affected if they're in the "
ckbx-style-
___" div.I also created a new checkboxes.min.css minified with YUI based on the altered checkboxes.css file.
Feel free to re-do the minification, it's a little different looking than the previous one was, but the change seemed to affect to many places to correct minified CSS by hand.
Hopefully this is a useful contribution to this project. It made my site work much better.
ckbx-style-15 issue with Bulma
Hello @hunzaboy , I would like to use your checkboxes. However, I have a problem when I use it together with Bulma (0.9.1) as you can see on the screenshot:
I've copied the code from your DEMO-Page:
As you can see, the 'X' (status false) is unfortunately not fully displayed as can be seen on your Demo page
Do you have an idea for me?
Thanks in advance
Update and refactor