new Heading(options) → {Class}
A heading component.
Name | Type | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | The options for the heading component. Properties
|
- Since
- 2.2.0
- Source
The Heading instance.
- Type:
- Class
import Heading from '@gravityforms/components/html/admin/elements/Heading';
function Example() {
const headingInstance = new Heading( {
content: 'This is a heading',
rendered: false,
renderOnInit: true,
tagName: 'h2',
target: '#example-target',
} );
}
Methods
(static) headingTemplate(options) → {string}
Generates the markup for a Heading Element in the admin.
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | The options for the heading component. Properties
|
- Since
- 2.2.0
- Source
- Type:
- string
import { headingTemplate } from '@gravityforms/components/html/admin/elements/Heading';
function Example() {
const headingTemplateHTML = headingTemplateTemplate( options );
document.body.insertAdjacentHTML( 'beforeend', headingTemplateHTML );
}