explaingit

drgullin/icheck

7,306CSSAudience · developerComplexity · 1/5Setup · easy

TLDR

jQuery plugin that replaces default browser checkboxes and radio buttons with fully customizable styled versions that look identical across all browsers and devices, with accessibility support built in.

Mindmap

mindmap
  root((iCheck))
    What it does
      Style checkboxes
      Style radio buttons
      Cross-browser look
    Features
      32 config options
      11 event callbacks
      6 built-in skins
      ARIA accessibility
    Tech Stack
      jQuery or Zepto
      CSS
    Audience
      Frontend developers
      UI designers
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Replace default browser checkboxes and radio buttons with custom-styled ones that look the same in Chrome, Firefox, Safari, and IE.

USE CASE 2

Add an indeterminate-state checkbox to a tree-selection UI where a parent is only partially checked.

USE CASE 3

React to checkbox events like checked, unchecked, or disabled with callbacks to update other parts of the page.

USE CASE 4

Style form inputs to match a custom design system without losing keyboard navigation or screen reader accessibility.

Tech stack

JavaScriptjQueryZeptoCSS

Getting it running

Difficulty · easy Time to first run · 5min

In plain English

iCheck is a jQuery and Zepto plugin that replaces the default look of checkboxes and radio buttons in web pages with fully customizable styled versions. The standard browser-provided checkboxes and radio buttons look different across browsers and are difficult to style with CSS alone. iCheck solves this by wrapping each input in a div element that can be given any appearance you want. The plugin works with both desktop browsers and mobile devices, including iOS, Android, BlackBerry, Windows Phone, and Amazon Kindle. It preserves accessibility by supporting keyboard navigation and screen readers through ARIA attributes. The file size is small, around 1 kilobyte when compressed. To use iCheck, you call it on any jQuery selector that contains checkboxes or radio buttons. The plugin finds the inputs and wraps each one, then applies CSS class names to reflect the current state: checked, unchecked, disabled, enabled, hovered, focused, active, or indeterminate. You control the visual appearance by styling those class names yourself, or by using one of six pre-made Retina-ready skins that ship with the plugin. There are 32 configuration options covering things like which class names to apply for each state, whether to increase the clickable area of small inputs, how to handle label interactions, and whether to enable ARIA accessibility support. The plugin also fires 11 callbacks so your code can react when an input is clicked, checked, unchecked, disabled, enabled, or toggled. Nine programmatic methods let you check, uncheck, disable, enable, or destroy inputs without user interaction. The plugin supports the indeterminate state that HTML5 allows for checkboxes, where the box appears neither fully checked nor unchecked, a visual that is sometimes used in tree-selection UIs. Changes made through iCheck are kept in sync with the original underlying input elements, so form submission and other standard browser behavior works as expected.

Copy-paste prompts

Prompt 1
Show me how to use iCheck to replace all checkboxes in a form with custom-styled versions using one of the six built-in skins.
Prompt 2
I need a folder-tree UI where parent checkboxes show as indeterminate when only some children are checked. Show me how to implement this with iCheck.
Prompt 3
Using iCheck, show me how to programmatically check, uncheck, and disable a set of checkboxes from JavaScript without any user interaction.
Prompt 4
How do I create a custom iCheck skin using only CSS, targeting the class names iCheck applies for checked, unchecked, hovered, and disabled states?
Open on GitHub → Explain another repo

← drgullin on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.