Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pretty-checkbox

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pretty-checkbox

A pure css library to beautify checkbox and radio buttons.

  • 3.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
27K
increased by0.15%
Maintainers
1
Weekly downloads
 
Created
Source


Pretty checkbox

pretty-checkbox.css

A pure CSS library to beautify checkbox and radio buttons.

Github Release Licence Downloads


Demo and documentation
Pretty checkbox preview

Features

  • 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! )

Installation

  • From CLI

Install the library from npm or yarn package manager

> npm install pretty-checkbox // or
> yarn add pretty-checkbox

Add pretty-checkbox.min.css in your html


<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pretty-checkbox@3.0/dist/pretty-checkbox.min.css"/>

Download the source from Github.

<link rel="stylesheet" href="../<PATH>/pretty-checkbox/dist/pretty-checkbox.min.css"/>

<PATH> is where the library is downloaded.


SCSS

You can also import pretty-checkbox.scss in your main scss file.

@import '~pretty-checkbox/src/pretty.scss';

Please refer the document for SCSS settings.

Usage

Pretty checkbox comes with many styles,

Class nameDescription
p-defaultBasic style
p-switchiOS like toggle style
p-iconCustom font icons
p-svgCustom SVG files, markup
p-imageTiny images

And three shapes p-round p-curve p-square (default)

Basic checkbox
  <div class="pretty p-default">
    <input type="checkbox" />
    <div class="state">
      <label>Check me</label>
    </div>
  </div>

Basic checkbox has three variants p-fill p-thick p-outline (default)

You can combine them.

  <div class="pretty p-default p-curve p-fill">
    <input type="checkbox" />
    <div class="state">
      <label>Fill</label>
    </div>
  </div>
---
Switch checkbox

Switch has three variants p-outline p-fill p-slim

  <div class="pretty p-switch p-fill">
    <input type="checkbox" />
    <div class="state">
      <label>On</label>
    </div>
  </div>
---
Custom Font icons
  <div class="pretty p-icon">
    <input type="checkbox">
    <div class="state">
      <i class="icon fa fa-check"></i>
      <label>Check me</label>
    </div>
  </div>
Note: class `icon` should 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.
---
SVG

Supports SVG file in tag, markup (<svg> ... </svg>) and sprites

  <div class="pretty p-svg">
    <input type="checkbox">
    <div class="state">
      <img class="svg" src="file.svg" />
      <label>Check me</label>
    </div>
  </div>
Note: class `svg` to be added in img tag or svg tag.
---
Image

Supports any type of valid image format.

  <div class="pretty p-image">
    <input type="checkbox" />
    <div class="state">
      <img class="image" src="/check.png" />
      <label>Block</label>
    </div>
  </div>
Note: class `image` to be added in img tag.
---
Colors

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

  <div class="pretty p-default p-curve p-thick">
    <input type="checkbox" />
    <div class="state p-warning">
      <label>Warning</label>
    </div>
  </div>
Note: Color class must be added in state class. Solid colors and Ouline colors have distinct role in font icons and toggle feature.

More

There are more features like Radio buttons , Toggle , States , Animations , Border less , Lock , Scale, SCSS Settings.

Please refer the documentation to know about them.

Browser support

Works in all modern browsers.

Chrome >= 26 Firefox >= 16 Safari >= 6.1 Opera >= 15 IE >= 9

Font Icon libraries

SVG

Inspiration

Contributions

Thanks to all those good people who spend their valuable time and helped to improve this library. Any Contributions are welcome!

License

This project is licensed under the MIT License

Keywords

FAQs

Package last updated on 21 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc