OOUI/Using OOUI in MediaWiki

Not much documentation yet; see https://gerrit.wikimedia.org/r/187079 for some ideas.

Since OOjs-ui is now in core, to use OOjs-ui from PHP extension code requires code similar to: function renderStopBookCreatorPage( $referer ) { $out = $this->getOutput; $out->enableOOUI; // ... more code here ... $group = new \OOUI\ButtonGroupWidget( array( // ... more widgets here ... ) );

$out->addHTML( $group ); }

The  call ensures that the proper theme and directionality is configured, and that the OOjs-ui styles are loaded. The OOjs-ui widgets are namespaced, so they must be prefixed with. Stringifying the widgets converts them to HTML, so your widgets can be added to the page using.

From JavaScript code, you just need to ensure that the  module is included in the dependencies. For example: $wgResourceModules += array(	'ext.collection' => array( 'dependencies' => 'oojs-ui' ), );