Extension:FontAwesome

PW
The Professional Wiki team maintains this extension professionally.
Professional Wiki provides official support for MediaWiki LTS releases only. It may work with other MediaWiki releases.
Category:Extensions by Professional Wiki Category:Extensions without an imageCategory:GPL licensed extensions
MediaWiki extensions manual
FontAwesome
Release status: stableCategory:Stable extensions
Implementation Parser function Category:Parser function extensions, Skin Category:Skin extensions
Description Provides parser functions to insert FontAwesome icons
Author(s) Stephan Gambke (F.trotttalk)
Maintainer(s) Professional Wiki
Latest version 3.0.0 (2025-03-16)
Compatibility policy For every MediaWiki release that is a Long Term Support release there is a corresponding branch in the extension.Category:Extensions with long-term support release branches compatibility policy
MediaWiki 1.39+Category:Extensions with manual MediaWiki version
PHP 7.4+
Database changes No
Composer mediawiki/font-awesomeCategory:Extensions supporting Composer
License GNU General Public License 3.0 or later
Download Category:Extensions in GitHub version control
README
$wgFaRenderMode
Category:All extensions

The FontAwesome extension provides parser functions to insert Font Awesome Free (version 6.7.2) icons into the wiki text.

Installation

  • Download and place the file(s) in a directory called FontAwesome in your extensions/ folder.
  • Add the following code at the bottom of your LocalSettings.php file:
    wfLoadExtension( 'FontAwesome' );
    
  • Configure as required.
  • Yes Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

Configuration

There are two render modes available for FontAwesome icons:

  • Web Fonts with CSS: This default implementation uses web fonts as the file format and relies on the browser to render icons as it would any custom font (webfonts)
  • SVG with JavaScript: This implementation encodes icon data and the mechanism to display them in the browser in JavaScript code that the browser executes (javascript)

The render mode can be selected by setting the configuration parameter $wgFaRenderMode in your "LocalSettings.php" file. Allowed values are: webfonts (default) and javascript.

Example
$wgFaRenderMode = 'javascript';

For a discussion of the advantages and drawbacks of the render modes see Performance & Font Awesome on fontawesome.com.

Usage

This extension defines three parser functions:

  • {{#far:...}} to insert an icon from the FontAwesome Regular font
  • {{#fas:...}} to insert an icon from the FontAwesome Solid font
  • {{#fab:...}} to insert an icon from the FontAwesome Brands font
Example
{{#fab:wikipedia-w}}

This will insert the "Wikipedia-W" icon in your page.

For valid icon names see https://fontawesome.com/v6/search.

Additional classes can be added after the icon name.

Example
{{#fab:wikipedia-w fa-spin}}

This will insert a spinning "Wikipedia-W" icon in your page.

For Font Awesome specific classes see Style Cheatsheet

Font Awesome CSS Custom Properties can be used as properties for classes.

License

Extension

GNU General Public License 3.0 or later

Font Awesome Free

Various licenses

Category:Font extension
Category:All extensions Category:Extensions by Professional Wiki Category:Extensions in GitHub version control Category:Extensions included in Miraheze Category:Extensions included in WikiForge Category:Extensions supporting Composer Category:Extensions with long-term support release branches compatibility policy Category:Extensions with manual MediaWiki version Category:Extensions without an image Category:Font extension Category:GPL licensed extensions Category:ParserFirstCallInit extensions Category:Parser function extensions Category:ResourceLoaderRegisterModules extensions Category:Skin extensions Category:Stable extensions