bootstrap.checkbox

WebJar for bootstrap.checkbox

License

License

GroupId

GroupId

org.webjars.bower
ArtifactId

ArtifactId

bootstrap.checkbox
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

bootstrap.checkbox
WebJar for bootstrap.checkbox
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/montrezorro/bootstrap-checkbox

Download bootstrap.checkbox

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bower/bootstrap.checkbox/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>bootstrap.checkbox</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/bootstrap.checkbox/
implementation 'org.webjars.bower:bootstrap.checkbox:1.0.0'
// https://jarcasting.com/artifacts/org.webjars.bower/bootstrap.checkbox/
implementation ("org.webjars.bower:bootstrap.checkbox:1.0.0")
'org.webjars.bower:bootstrap.checkbox:jar:1.0.0'
<dependency org="org.webjars.bower" name="bootstrap.checkbox" rev="1.0.0">
  <artifact name="bootstrap.checkbox" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='bootstrap.checkbox', version='1.0.0')
)
libraryDependencies += "org.webjars.bower" % "bootstrap.checkbox" % "1.0.0"
[org.webjars.bower/bootstrap.checkbox "1.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

bootstrap-checkbox

A checkbox component based on bootstrap framework

Author

Roberto Montresor

Documentation

You can find demo and documentation here.

Usage

Remember to include both the .js and the .css in your HTML header.

Create your <input type="checkbox"> with the .checkbox class.

<input type="checkbox" class="checkbox" />
<input type="checkbox" class="checkbox" checked="checked"/>
<input type="checkbox" class="checkbox" disabled="disabled"/>
<input type="checkbox" class="checkbox" checked="checked" disabled="disabled"/>

Enable Bootstrap-checkbox via JavaScript:

$('.checkbox').checkbox();

Or just

$('input[type="checkbox"]').checkbox();

Options

Options can be passed via data attributes or JavaScript.

$('input[type="checkbox"]').checkbox({
  buttonStyle: 'btn-link',
  buttonStyleChecked: 'btn-inverse',
  checkedClass: 'fa fa-check',
  uncheckedClass: 'fa fa-square-o',
  defaultState: false,
  defaultEnabled: true,
  
  checked: false,
  enabled: true
});

You can append or prepend a label via the data-label or data-label-prepend attribute. You can set a default state (used when you reset a form) via the data-default-state attribute. You can set a default abilitation (used when you reset a form) via the data-default-enabled attribute.

Methods

$('input[type="checkbox"]').checkbox('click'); // change input's state
$('input[type="checkbox"]').checkbox('toggleEnabled'); // change input's enabled
$('input[type="checkbox"]').checkbox('check'); // change input's state to checked
$('input[type="checkbox"]').checkbox('unCheck'); // change input's state to unchecked

Copyright and license

Copyright (C) 2014 Roberto Montresor

Licensed under the Apache License 2.0.

Versions

Version
1.0.0