Skip to main content

Embed the Growth Hub Widget With the iframe Web Component

Easily add the Growth Hub widget to your website and customize its size and behavior.

Yasen Marinov avatar
Written by Yasen Marinov
Updated yesterday

Use the <growth-hub-iframe> web component to quickly embed the Growth Hub widget into your website. It automatically handles height changes and scroll events, so you don't have to manage them manually.

Before you start

To embed the widget, you need:

  • A valid src URL for your organization's Growth Hub page.

  • Optionally, you can specify values for width, height, or autoHeight, depending on your layout needs.


Step 1: Load the widget script

Add this script tag to your HTML file to load the Growth Hub widget:

<script src="https://e-commerce.officernd.com/widget.js"></script>

Step 2: Add the Web Component

Use the <growth-hub-iframe> tag in your HTML and set its attributes. Make sure the src attribute always points to your organization’s Growth Hub page:

Basic example

<growth-hub-iframe src="https://e-commerce.officernd.com/[client-org-slug]"></growth-hub-iframe>

Enable auto height

Automatically adjusts height when content changes:

<growth-hub-iframe
src="https://e-commerce.officernd.com/[client-org-slug]"
autoHeight>
</growth-hub-iframe>

Set custom width and height

Specify exact dimensions using valid CSS values:

<growth-hub-iframe
src="https://e-commerce.officernd.com/[client-org-slug]"
width="900px"
height="500px">
</growth-hub-iframe>

Web component attributes

Attribute

Required

Description

src

Yes

The full URL to your Growth Hub widget (client-specific).

autoHeight
(boolean)

No

Automatically resizes the iframe height as its content changes.

width
(string)

No

Sets the iframe width. Defaults to 100%. Accepts any valid CSS value.

height
(string)

No

Sets the iframe height. Defaults to 100%. Accepts any valid CSS value.


Note: If neither height nor autoHeight are set, the iframe will attempt to fill 100% of the height of its parent container.

Widget behaviour

  • Dynamic Height:
    When autoHeight is enabled, the component listens for content changes within the iframe and adjusts its height automatically.

  • Fallback Height:
    If you do not specify either autoHeight or a fixed height, the widget will default to trying to fill 100% of its parent container's height.

  • Custom Sizing:
    The width and height attributes accept complete CSS unit values, offering flexibility to match your design needs.

  • Scroll Handling:
    The component automatically handles scroll events—scrolling to the top or bottom when the app requires them—further reducing manual integration work.

Did this answer your question?