QDmodal

QDmodal is a library allowing scripts to display a modal dialog. It provides an adaptive layout without complex styling by using the CSS flexbox layout.

QDmodal supports both vanilla MediaWiki wikis (e.g. Wikipedia) and the Fandom wiki platform (where it'll match the theme of the wiki it's displayed on). It should work in most browsers released within the last few years, specifically browsers with unprefixed support for CSS flexbox.

Loading the library
First, you'll need to make sure the QDmodal script is loaded:

Using the modal
Once the script has been loaded, you can initialise a new modal using the  constructor: The  variable will be a modal object.

To show the modal, use the modal object's  function with a data object as the argument: Arbitrary properties may also be included here. These can be useful for storing information about the current modal content for use within a hook.

To hide the modal, use the modal object's  function (not usually needed):