We’ve migrated our documentation to a new site, which means some URLs have changed.
Subscriptions

How does the 'Allow user to close modal' checkbox work in Lightweight Templates?

In Composer, the "Allow user to close modal" checkbox for Lightweight Templates (LWT) controls the value of showCloseButton in the widget store, but it does not inject a close button automatically.

A close button will only appear if the template includes PianoHeader or PianoCloseButton. This is different from Classic templates, where Composer injects the close button into the modal overlay.

If you use PianoCloseButton or your own close button and you want it to respond to the showCloseButton property from the Composer card, you need to wrap it as follows:

HTML
<Show when={context.isCloseButtonVisible}>
  <button onClick={context.close} />
</Show>

Last updated: