Skip to content

HTML - Custom Content

Render custom HTML or React components in a popup.

jsx
openPopup('html', {
  data: {
    html: <h1>Hello World!</h1>
  }
});

Or with access to closePopup:

jsx
openPopup('html', {
  data: {
    html: ({ closePopup }) => (
      <div>
        <h1>Custom Content</h1>
        <button onClick={() => closePopup()}>Close</button>
      </div>
    )
  }
});

Props (data):

PropertyTypeDescription
htmlReactNode | FunctionCustom content or render function. If a function, it receives { closePopup }.