Landbot.Popup

Popup widget anchored to a launcher bubble.

This class extends Landbot.Widget. See Widget methods and properties.

Constructor

Landbot.Popup

Landbot.Popup(config)

Parameters:

  • config: Object

Create a Landbot Popup widget with given config.

Methods

open

open()

Open popup widget.

close

close()

Close popup widget.

showProactive

showProactive(messages)

Parameters:

  • messages: Array

Show a series of proactive messages (array of Messages).

myLandbot.showProactive([
  {
    type: 'text',
    samurai: -1,
    message: 'Hi there!',
  }
]);

hideProactive

hideProactive()

Close proactive messages.

A common pattern: dismiss the proactive automatically after a few seconds.

myLandbot.onLoad(function () {
  setTimeout(function () {
    myLandbot.hideProactive();
  }, 15000);
});

Customising the launcher and proactive UI

The launcher bubble is the parent-page wrapper .LandbotPopup (with .LandbotPopup.is-open while the chat is visible). The proactive teaser is .LivechatProactive inside the iframe. Both are documented with the rest of the launcher classes in Styling → Widget launcher and bubble.

Because the launcher sits outside the iframe and the chat content sits inside, real launcher tweaks usually inject rules into both stylesheets. See Embedding → Injecting CSS at runtime for the two-scope pattern.