ForgeComponents
en

Components

j-Icons

jComponent 20 · jcomponent@20 component Example loaded with jComponent 20
  • Total.js Icons list
  • singleton

Configuration:

  • search {String} a placeholder for search field (default: Search)
  • list {String} URL address for obtaining list of icons (default: Total.js Icons CDN)
  • NEW: custom {String} a link to the custom icon list (it uses tic ti-NAME prefix)

Usage

var opt = {};

// opt.offsetX {Number}    : adds X offset (default: 0)
// opt.offsetY {Number}    : adds Y offset (default: 0)
// opt.align {String}      : align `left` (default), `center` or `right`
// opt.position {String}   : position `top` (default) or `bottom`
// opt.empty {Boolean}     : adds empty icon (default: false)

opt.element = YOUR_ELEMENT;
// or if you want to use a fixed position:
// opt.x {Number}          : `x` position
// opt.y {Number}          : `y` position

opt.callback = function(icon) {
	console.log(icon);
};

SETTER('icons/show', opt);

Use it with <ui-component name="icons">. 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
<ui-component name="icons"></ui-component>

<div class="container">
	<div class="row">
		<div class="col-xs-4 col-xs-offset-4" style="text-align:center">
			<a href="javascript:void(0)" style="color:black;font-size:30px"><i class="ti ti-smile"></i></a>
		</div>
	</div>
</div>

<script>
$(document).on('click', 'a', function() {
	var opt = {};
	opt.align = 'center';
	opt.position = 'top';
	opt.element = this;
	opt.callback = function(selected) {
		console.log(selected);
	};
	SETTER('icons/show', opt);
});
</script>