# j-ToggleButton

> Icons can be in the form: circle or ti ti-circle.

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

__Configuration__:

- `required` {Boolean} optional, enables "required" (default: `false`)
- `disabled` {Boolean} optional, disables this component
- `icontrue` {String} optional, toggles FontAwesome icons if the value is `true`
- `iconfalse` {String} optional, toggles FontAwesome icons if the value is `false`

Icons can be in the form: `circle` or `ti ti-circle`.

Use it with `<ui-component name="togglebutton">`. 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-4">
			<ui-component name="togglebutton" path="form.darkmode" config="icontrue:lightbulb"></ui-component>
		</div>
	</div>
</div>

<script>
	var form = {};
	form.darkmode = false;
	WATCH('form.darkmode', function(path, value) {
		$('body').tclass('ui-dark', value === true);
	});
</script>
```
