Usage
Check Box
A standard checkbox
Static Check Box
A checkbox can also be used without using javascript by creating the check box as a label with a for tag matching the id
attribute of the input field.
Types
Slider
A checkbox can be formatted to show user selection as a slider
Toggle
A checkbox can be formatted to show user selection as a toggle
Radio Box
A checkbox can be formatted as a radio element. This means it is an exclusive option.
Variations
Size
A checkbox can be a different size.
Behavior
A checkbox can change to show a user has selected it
A checkbox can change to show a user has not selected it
A checkbox can toggle between states
Examples
Example of using checkbox states to alter multiple checkboxes
Settings
Checkbox Settings | ||
---|---|---|
required | auto | Setting to true/false will determine whether an input will allow no selection. Auto will set disallow this behavior only for radio boxes |
context | false | A selector or jQuery object to use as a delegated event context |
Callbacks | ||
---|---|---|
onChange | None | Callback after a checkbox is either disabled or enabled. |
onEnable | None | Callback after a checkbox is enabled. |
onDisable | None | Callback after a checkbox is disabled. |
DOM Settings
DOM settings specify how this module should interface with the DOM
Setting | Default | Description |
---|---|---|
namespace | checkbox | Event namespace. Makes sure module teardown does not effect other events attached to an element. |
selector |
selector : {
input : 'input',
label : 'label'
}
|
|
className |
className : {
radio : 'radio'
}
|