# j-Console2

> j-Console2: easy usage; supports dark mode

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

- supports __dark mode__

__Configuration__:

- `icon {String}` a label icon (default: `ti ti-script`)
- `name {String}` a label (default: `Console`)
- `datasource {String}` __required__ a path to a data-source `Array`
- `clear {String_LinkToFunction/Boolean}` adds a clear button (default: `true`)
- `autoclose {Boolean}` console automatically closes after clearing (default: `true`)
- `autoshow {Boolean}` console automatically opens after new logs (default: `true`)
- `height {Number}` console height in pixels (default: `150`)

Use it with `<ui-component name="console2">`. 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
<style>
	body { background-color: #D0D0D0; }
</style>

<ui-component name="console2" path="visible" config="datasource:logs"></ui-component>

<script>

	var visible = true;
	var logs = [];

	logs.push({ type: 'info', body: 'Lorem <b>ipsum</b> dolor sit amet, consectetur adipisicing elit. Soluta, ea.' });
	logs.push({ type: 'error', body: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Soluta, ea.' });

	// 2 seconds delay
	setTimeout(() => PUSH('logs', { type: 'warning', body: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Hic, tempora.' }), 2000);

</script>
```
