---
title: "Feature: #70583 - Introduced Icon API in JavaScript"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:feature-70583"
source: "Changelog/7.6/Feature-70583-IntroducedIconAPIInJavaScript.rst"
modified: "2026-09-15T10:46:36+00:00"
---

# Feature: #70583 - Introduced Icon API in JavaScript

See [forge#70583](https://forge.typo3.org/issues/70583)

## Description

A JavaScript-based icon API based on the PHP API has been introduced. The methods `getIcon()`
and `getIcons()` can be called in a RequireJS module.

When imported in a RequireJS module, a developer can fetch icons via JavaScript with the same parameters as in PHP.
The methods `getIcon()` and `getIcons()` return `Promise` objects.

## Importing

```javascript
define(['jquery', 'TYPO3/CMS/Backend/Icons'], function($, Icons) {
});
```

## Get icons

A single icon can be fetched by `getIcon()` which takes four parameters:

-   **identifier**

    The icon identifier.

-   **size**

    The size of the icon. Please use the properties of the `Icons.sizes` object.

-   **overlayIdentifier**

    An overlay identifier rendered on the icon.

-   **state**

    The state of the icon. Please use the properties of the `Icons.states` object.

To use the fetched icons, chain the `done()` method to the promise.

### Examples

```javascript
// Get a single icon
Icons.getIcon('spinner-circle-light', Icons.sizes.small).done(function(spinner) {
	$toolbarItemIcon.replaceWith(spinner);
});
```
