Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A pure CSS library to beautify checkbox and radio buttons.

License

NotificationsYou must be signed in to change notification settings

lokesh-coder/pretty-checkbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Pretty checkbox

pretty-checkbox.css

A pure CSS library to beautify checkbox and radio buttons.

Github ReleaseLicenceDownloads


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 fromnpm oryarn package manager

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

Addpretty-checkbox.min.css in your html


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

Download the source from Github.

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

<PATH> is where the library is downloaded.


SCSS

You can also importpretty-checkbox.scss in your main scss file.

@import'~pretty-checkbox/src/pretty-checkbox.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 shapesp-roundp-curvep-square (default)

Basic checkbox

<divclass="pretty p-default"><inputtype="checkbox"/><divclass="state"><label>Check me</label></div></div>

Basic checkbox has three variantsp-fillp-thickp-outline (default)

You can combine them.

<divclass="pretty p-default p-curve p-fill"><inputtype="checkbox"/><divclass="state"><label>Fill</label></div></div>
---

Switch checkbox

Switch has three variantsp-outlinep-fillp-slim

<divclass="pretty p-switch p-fill"><inputtype="checkbox"/><divclass="state"><label>On</label></div></div>
---

Custom Font icons

<divclass="pretty p-icon"><inputtype="checkbox"><divclass="state"><iclass="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

<divclass="pretty p-svg"><inputtype="checkbox"><divclass="state"><imgclass="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.

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

Colors

There are five solid colorsp-primaryp-successp-warningp-infop-danger

And five outline colorsp-primary-op-success-op-warning-op-info-op-danger-o

<divclass="pretty p-default p-curve p-thick"><inputtype="checkbox"/><divclass="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 likeRadio buttons ,Toggle ,States ,Animations ,Border less ,Lock ,Scale,SCSS Settings.

Please refer thedocumentation to know about them.

Browser support

Works in all modern browsers.

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

Font Icon libraries

SVG

Libraries

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


[8]ページ先頭

©2009-2025 Movatter.jp