Home

Awesome

angular-material-checkbox

Simple angular check-box/toggle button directive using Google material design icons.

Click Here for demo.

###Key Features

Getting Started

Download the package, and include the /checkbox-directive.js file in your page.

bower install angular-material-checkbox --save

Then add material icons with following line in your index.html head section:

<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

Also add the sb.checkbox as dependency to your Angular App main module, e.g.

var app = angular.module('app', ['sb.checkbox']);

Usage(With minimum options)

As an element(For newer HTML5 browsers):

<sb-checkbox
	label="test label"
	ng-model="user.test1"
 />
<span> model value: {{user.test1}} </span>

As an attribute(If you want to support older IE, also use angular 1.2.8):

<!-- Used as attribute to support <=IE9 versions -->
<div sb-checkbox label="test labrl"
	 			 ng-model="user.test1">
</div>
<span> model value: {{user.test1}} </span>

NOTE: sb-checkbox class is added in check-box container div you can override it to apply custom css.

Description of attributes

AttributeDescriptionRequiredExample
ng-modelmodel of checkboxYeschoices.checkbox1
checked-icon-nameGoogle material design icon name for checked stateNocheck_circle, check_box OR &#xE86C; , &#xE834; (For IE 9 or below)
unchecked-icon-nameGoogle material design icon name for unchecked stateNoradio_button_unchecked, check_box_outline_blank OR &#xE836; , &#xE835; (For IE 9 or below)
checked-icon-colorIcon color in hex for checked stateNo'#009688'
unchecked-icon-colorIcon color in hex for unchecked stateNo'#B2DFDB'
sizesize of checkboxNosmall, medium or large
pre-selectedif 'true' checkbox will be selected at start, defaults to falseNotrue OR false
show-labelDon't show label <span> if false, defaults to trueNotrue OR false