Skip to content

Popup Component

o5faruk edited this page May 2, 2021 · 2 revisions

⚠️⚠️⚠️

This sdk documentation is deprecated and will not be updated. Check out our new docs at https://sdk.buildfire.com/docs/pupup/

⚠️⚠️⚠️

buildfire.components.popup

This component provides a rich modal for plugins.

Requirements

<script src="../../../scripts/buildfire/components/popup/popup.js"></script>

Methods

buildfire.components.popup.display(options, callback)

options

const options = {
  title: 'string'
  subTitle: 'string'
  showDismissButton: true || false
  action: { // action item },
  richContent: htmlContent

  design: {
    title: { align: 'center' },
    fullScreen: true || false,
    textColor: '#fff'
    backgroundColor: '#000'
 }

}

callback

Parameters:

  • error: any errors returned
  • result: result of user interactions
    • buttonType: button clicked. 'dismiss' or 'action'
    • value: value of the action
const callback = (error, result) => {
  if (error) return console.error(error);

  switch (result.buttonType) {
    // handle button type
  }
}
Clone this wiki locally