ForgeComponents
en

Components

j-Console2

jComponent 20 · jcomponent@20 component Example loaded with jComponent 20
  • 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.

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>