# j-iFrame

> The component renders another URL address (stored in the path attribute) directly in the iframe. The biggest benefit is auto-resizing of the iframe element according to the parent selector.

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

The component renders another URL address (stored in the `path` attribute) directly in the iframe. The biggest benefit is auto-resizing of the iframe element according to the `parent` selector.


__Configuration__:

- `parent {String}` optional, a container selector (default: `window`)
- `scrollbar {Boolean}` optional, enables native iframe scrolling (default: `false`)
- `margin {Number}` optional, a vertical margin (default: `0`)
- __NEW__: `marginxs {Number}` optional, a vertical margin for extra small display
- __NEW__: `marginsm {Number}` optional, a vertical margin for small display
- __NEW__: `marginmd {Number}` optional, a vertical margin for medium display
- __NEW__: `marginlg {Number}` optional, a vertical margin for large display
- __NEW__: `message {String}` optional, a link to the `function(msg)`
- __NEW__: `ready {String}` optional, a link to the `function(com)` when the iframe is ready
- __NEW__: `autohide {Boolean}` optional, adds `hidden` class if the iframe is blank

__Methods__:

- __NEW__: `SETTER('iframe/send', { your_message_data })` for sending message to the iframe

Use it with `<ui-component name="iframe">`. 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
<ui-component name="iframe" path="common.url"></ui-component>

<script>
	var common = { url: 'https://www.totaljs.com' };
</script>
```
