new StackedIcon(options) → {Class}
A stackedIcon component .
Name | Type | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | The options for the component. Properties
|
- Since
- 1.1.16
The class instance.
- Type:
- Class
import StackedIcon from '@gravityforms/components/html/admin/elements/StackedIcon';
function Example() {
const stackedIconInstance = new StackedIcon( {
id: 'example-stackedIcon',
renderOnInit: false,
target: '#example-target',
targetPosition: 'beforeend',
theme: 'cosmos',
} );
// Some time later we can render it. This is only done if we set renderOnInit to false.
// If true it will render on initialization.
stackedIconInstance.init();
}
Methods
(static) init() → {void}
Initialize the component.
- Since
- 1.1.16
- Type:
- void
(static) render() → {void}
Renders the component into the dom.
- Since
- 1.1.16
- Type:
- void
(static) stackedIconTemplate(options) → {string}
Generates the markup for a stackedIcon in the admin.
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | The options for the component template. Properties
|
- Since
- 1.1.16
- Type:
- string
import { stackedIconTemplate } from '@gravityforms/components/html/admin/elements/StackedIcon';
function Example() {
const stackedIconTemplateHTML = stackedIconTemplateTemplate( options );
document.body.insertAdjacentHTML( 'beforeend', stackedIconTemplateHTML );
}