OOUI/Using OOUI in MediaWiki

OOjs UI is included in MediaWiki core, available to be used by both PHP and JavaScript code.

PHP
To use OOjs UI from PHP extension code requires code similar to:

(implemented by class ) ensures that the proper theme and directionality is configured, and that the page loads the OOjs UI styles. The OOjs UI widgets are namespaced, so they must be prefixed with. Stringifying the widgets converts them to HTML, so you can add widgets to the page using.

HTMLForm
You can use the  display format for HTMLForm forms to renders them using OOjs UI. See HTMLForm.

TODO Write more.

Technical notes
TODO Adapt from T98029#1475549

JavaScript
From JavaScript code, you just need to list the  module as a dependency of your modules that use OOjs UI. For example:

See 187079 for some more ideas.

Infusion
TODO Write me.

MediaWiki-specific OOjs UI widgets
Several MediaWiki-specific OOjs UI widgets are available under the  (JavaScript) or   (PHP) namespace, implementing interface elements common in MediaWiki.

TODO Write me.