Signature
Parameters
Array of icon loader definitions. Each loader can be either synchronous (with icons provided directly) or asynchronous (with a loader function).
Return value
void - This method does not return a value.
Throws
- Throws an error if an icon loader doesn’t have a
nameproperty - Throws an error if an icon loader has neither
iconsnorloaderproperty
Examples
Synchronous icon pack
Asynchronous icon pack
Multiple icon packs
Using icons in diagrams
Loading from NPM packages
Creating a reusable icon pack module
Error handling
Icon reference format
When using registered icons in diagrams, reference them as:prefixis the icon packnameiconNameis the icon identifier within that pack
@icon:fa:home- Home icon from Font Awesome@icon:mdi:account- Account icon from Material Design Icons@icon:custom:logo- Custom logo icon
Iconify JSON format
Icon data must follow the Iconify JSON format:Usage notes
- Icon packs must be registered before rendering diagrams that use them
- Async loaders only fetch data when an icon from that pack is first used
- Icon names are case-sensitive
- The
namefield must be unique across all registered icon packs - Icons are rendered as SVG and inherit diagram styling where applicable
- If an icon is not found, a fallback “unknown” icon (question mark) is displayed
Related methods
- registerExternalDiagrams() - Register custom diagram types
- registerLayoutLoaders() - Register layout algorithms
- initialize() - Configure Mermaid