# j-FloatingInput

> j-FloatingInput: singleton; supports dark mode

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

- singleton
- supports __dark mode__

__Methods__:

Method: `component.show(options)`

- `options.element {Element/jQuery Element}`
- `options.offsetX {Number}` optional, `x` offset (default: `0`)
- `options.offsetY {Number}` optional, `y` offset (default: `0`)
- `options.offsetWidth {Number}` optional, `width` offset (default: `0`)
- `options.placeholder {String}` optional, a placeholder for search field
- `options.minwidth {Number}` optional, a minimal width, default `200`
- `options.maxwidth {Number}` optional, a maximal width, default `infinite`
- `options.maxlength {Number}` optional, a maximal length of value, default `50`
- `options.callback(value, element) {Function}` is triggered when the user clicks on the item
- `options.icon {String}` optional, Font-Awesome icon
- `options.close {Function}` optional, can determine closing of panel
- `options.align {String}` optional, `left` (default), `right` or `center`
- `options.value {String}` optional, a default value for the input
- `options.position {String}` optional, `top` (default), `bottom`
- `options.summary {String}` additional help content
- `options.monospace {Boolean}` enables monospace font
- `options.select {Boolean}` selects text
- __NEW__ `options.multiline {Boolean}` enables multiline
- __NEW__ `options.height {Number}` a height for multiline (default: `100`)

Method: `component.hide()`

__Configuration__:

- `placeholder` - a placeholder for the input

Use it with `<ui-component name="floatinginput">`. 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: #F0F0F0; }
</style>

<ui-component name="floatinginput" config="placeholder:Type something ..."></ui-component>

<div class="container">
	<a href="javascript:void(0)">Type your name</a>
</div>

<script>
	$(document).on('click', 'a', function() {

		var opt = {};
		opt.element = this;
		opt.callback = function(value) {
			console.log('CLICK', value);
		};

		SETTER('floatinginput/show', opt);
	});
</script>
```
