# j-Checkboxlist

> j-Checkboxlist: for custom design you can use j-CheckboxListExpert; now supports darkmode

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: en
Content-SHA256: 3251fbc7735fe1228efee43f8329cb89a39e90d37d6f26a8217b3d81016408ce
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

- for custom design you can use __j-CheckboxListExpert__
- now supports darkmode

__Configuration__:

- `required` {Boolean} (optional) enables "required" (default: `false`)
- `items` {String} (optional) static items `key1|value1, key2 with value, key3|value`
- `icon` {String} (optional) icon for label without `fa-` e.g. `home`, `cog`, etc.
- `checkicon` {String} (optional) check icon without `fa-`, (default: `check`).
- `label` {String} (optional) label (default is HTML content)
- `type` {String} (optional) can be `number` (converts `String` values to `Number`)
- `datasource` {String} path to data-source (must be array)
- `text` {String} determines a property name for text (in data-source), default: `name`
- `value` {String} determines a property name for value (in data-source) default :`id`
- `empty` {String} (optional) empty text for empty data-source
- `disabled` {Boolean} (optional) disables this component

Use it with `<ui-component name="checkboxlist">`. When the component is not loaded yet, jComponent downloads it on first use from the address in `DEF.fallback` (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.

```html example.html
<div class="container">
	<div class="row">
		<div class="col-md-8 col-md-offset-2">
			<ui-component name="checkboxlist" path="selected" config="datasource:datasource;class:.col-sm-2;type:number">Frameworks</ui-component>
		</div>
	</div>
	<br />
	<div class="row">
		<div class="col-md-8 col-md-offset-2">
			<ui-component name="checkboxlist" path="selected" config="icon:home;required:true;items:Total.js|1,jComponent|2,Express.js|3,React|4,Angular.js|5;class:.col-sm-2;type:number">Frameworks</ui-component>
		</div>
	</div>
</div>

<script>
	var selected = [1, 2];
	var datasource = [{ id: 1, name: 'Total.js' }, { id: 2, name: 'jComponent' }, { id: 3, name: 'Express.js' }, { id: 4, name: 'React' }, { id: 5, name: 'Angular.js' }];
</script>
```
