A pure css library to beautify checkbox and radio buttons.
npm install @djthoms/pretty-checkbox

- Basic
- Shapes - _Square_, _Curve_, _Round_
- Variants - _Default_, _Fill_, _Thick_
- Colors - _Primary_, _Success_, _Info_, _Warning_, _Danger_
- Color types - _Solid_, _Outline_
- Animations - _Smooth_, _Tada_, _Jelly_, _Pulse_, _Rotate_
- Switch - iOS style - _Outline_, _Fill_, _Slim_
- Responsive
- No JavaScript
- Custom Font Icons
- SVG Icons
- Image support
- Toggle between icons / SVG's / images
- Lock
- State - _Focus_, _Hover_, _Indeterminate_
- Supports frameworks - _Bootstrap_, _Foundation_, _Sematic UI_, _Bulma_, ...
- SCSS customization
- Supports all modern browsers, including mobile devices
- Print friendly
- and more... ( _I am kidding, that's all!_ )
Install using npm or yarn:
``sh`
npm install @djthoms/pretty-checkbox # or
yarn add @djthoms/pretty-checkbox
Add pretty-checkbox.min.css in your html:
`html`
rel="stylesheet"
href="https://unpkg.com/@djthoms/pretty-checkbox/dist/pretty-checkbox.min.css"
/>
Download the source from Github.
`html`
is where the library is downloaded.
You can also import pretty-checkbox.scss in your main scss file.
`scss`
@import '~@djthoms/pretty-checkbox/src/pretty-checkbox.scss';
Please refer the document for SCSS settings.
Pretty checkbox comes with many styles,
| Class name | Description |
| :---------- | :----------------------- |
| p-default | Basic style |p-switch
| | iOS like toggle style |p-icon
| | Custom font icons |p-svg
| | Custom SVG files, markup |p-image
| | Tiny images |
And three shapes p-round p-curve p-square (default)
`html`
Basic checkbox has three variants p-fill p-thick p-outline (default)
You can combine them.
`html`
Switch has three variants p-outline p-fill p-slim
`html`
`html`
Note: class iconshould be added along with icon class names
Note: For icons to work, you need to add appropriate font icons library. In above example , we used font awesome icon. So, FontAwesome should be included separately.
Supports SVG file in tag, markup (
) and sprites
`html`
Note: class svgto be added in img tag or svg tag.
Supports any type of valid image format.
`html`

Note: class imageto be added in img tag.
There are five solid colors p-primary p-success p-warning p-info p-danger
And five outline colors p-primary-o p-success-o p-warning-o p-info-o p-danger-o
`html`
Note: Color class must be added in state class. Solid colors and Ouline colors have distinct role in font icons and toggle feature.
Include rtl.css in your source file :smile:
There are more features like _Radio buttons_ , _Toggle_ , _States_ , _Animations_ , _Border less_ , _Lock_ , _Scale_, _SCSS Settings_.
Please refer the documentation to know about them.
Works in all modern browsers.
Chrome >= 26 Firefox >= 16 Safari >= 6.1 Opera >= 15 IE >= 9`
- Font awesome
- Bootstrap Glyphicons
- Material icon ( MDI )
- Material icon ( ZMDI )
- Ion icons
- Typicons
- Material icon ( Google )
- Others not tested, but will work ( 99% ).
- VueJs - pretty-checkbox-vue
- Angular - ngx-pretty-checkbox
- React - pretty-checkbox-react
- Awesome Bootstrap Checkbox - Idea
- Animista - Animations
Thanks to all those good people who spend their valuable time and helped to improve this library. Any Contributions are welcome!
This project is licensed under the MIT License