# @commercetools-uikit/icons

> All SVG icons are rendered as React components.

Latest version **20.6.7** (published 2026-07-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @commercetools-uikit/icons
pnpm add @commercetools-uikit/icons
yarn add @commercetools-uikit/icons
bun add @commercetools-uikit/icons
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 20.6.7 |
| Published | 2026-07-17 |
| First published | 2019-11-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 9 |
| Unpacked size | 2 MB |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 154 |
| Maintainers | emmenko, commercetools-admin, tdeekens |
| Keywords | javascript, typescript, design-system, react, uikit |

## Links

- npm: https://www.npmjs.com/package/@commercetools-uikit/icons
- Repository: https://github.com/commercetools/ui-kit
- Homepage: https://uikit.commercetools.com
- Issues: https://github.com/commercetools/ui-kit/issues
- npm.io page: https://npm.io/package/@commercetools-uikit/icons

## Dependencies (9)

- [dompurify](https://npm.io/package/dompurify.md) 3.4.9
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.20.13
- [@emotion/react](https://npm.io/package/@emotion/react.md) ^11.10.5
- [react-from-dom](https://npm.io/package/react-from-dom.md) 0.7.5
- [@emotion/styled](https://npm.io/package/@emotion/styled.md) ^11.10.5
- [@types/dompurify](https://npm.io/package/@types/dompurify.md) ^2.4.0
- [@babel/runtime-corejs3](https://npm.io/package/@babel/runtime-corejs3.md) ^7.20.13
- [@commercetools-uikit/utils](https://npm.io/package/@commercetools-uikit/utils.md) ^20.6.7
- [@commercetools-uikit/design-system](https://npm.io/package/@commercetools-uikit/design-system.md) ^20.6.7

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 20.6.7 (latest) — 2026-07-17
- 0.0.0-canary-20260831181816 (canary) — 2026-08-31
- 0.0.0-FEC-938-ui-kit-post-pnpm-tooling-polish-catalogs-bundlewatch-bundlesize-20260518121756 (FEC-938-ui-kit-post-pnpm-tooling-polish-catalogs-bundlewatch-bundlesize) — 2026-05-18
- 0.0.0-migration-pnpm-20260513114959 (migration-pnpm) — 2026-05-13
- 0.0.0-CRAFT-2040-rich-text-input-destroys-hyperlink-tag-20260219190637 (CRAFT-2040-rich-text-input-destroys-hyperlink-tag) — 2026-02-19
- 0.0.0-fec-155-react-19-20250528075244 (fec-155-react-19) — 2025-05-28
- 0.0.0-FCT-1500-adjust-legacy-css-reset-20250527090339 (FCT-1500-adjust-legacy-css-reset) — 2025-05-27
- 0.0.0-SUPPORT-32352-de-ch-money-input-20250509174254 (SUPPORT-32352-de-ch-money-input) — 2025-05-09
- 0.0.0-main-20250115172531 (main) — 2025-01-15
- 0.0.0-preview-fec-155-react-19-20250113184401 (preview-fec-155-react-19) — 2025-01-13
- 0.0.0-preview-test-icon-entrypoints-20241212201418 (preview-test-icon-entrypoints) — 2024-12-12
- 0.0.0-preview-test-icon-pure-annotations-20241211181046 (preview-test-icon-pure-annotations) — 2024-12-11
- 0.0.0-preview-test-icon-bundle-20241210182318 (preview-test-icon-bundle) — 2024-12-10
- 0.0.0-preview-test-canary-preview-20241204111237 (preview-test-canary-preview) — 2024-12-04
- 0.0.0-preview-FCT-1187-20241024123200 (preview) — 2024-10-24
- … 1034 more at https://npm.io/package/@commercetools-uikit/icons/versions

## README

# Icons

## Description

All SVG icons are rendered as React components.

## Usage

```js
import { ExportIcon } from '@commercetools-uikit/icons';

<ExportIcon />;
```

## Properties

| Props   | Type     | Required | Values                                                                   | Default | Description                                                                                            |
| ------- | -------- | :------: | ------------------------------------------------------------------------ | ------- | ------------------------------------------------------------------------------------------------------ |
| `size`  | `string` |          | 'small', 'medium', 'big', 'scale'                                        | 'big'   | Specifies the icon size (if `scale` is selected, the dimensions will scale according with the parents) |
| `color` | `string` |          | 'solid', 'neutral60', 'info', 'primary', 'primary40', 'warning', 'error' | 'solid' | Specifies the icon color                                                                               |

### Where to use

Main use cases are:

- Buttons

  ```jsx
  <SecondaryButton
    onClick={() => {}}
    iconLeft={<ExportIcon />}
    label={this.props.intl.formatMessage(messages.exportList)}
  />
  ```

- Icon Buttons

  ```jsx
  <IconButton
    onClick={() => {}}
    icon={<ExportIcon />}
    label={this.props.intl.formatMessage(messages.exportList)}
  />
  ```

## Inline SVG for rendering custom icons

If you need to render an SVG icon that is not part of the default set of icons, it's possible to render it using a special component `<InlineSvg>`.

The component is exported as a separate entry point:

```js
import InlineSvg from '@commercetools-uikit/icons/inline-svg';
```

### Usage

```js
import InlineSvg from '@commercetools-uikit/icons/inline-svg';

const svg = `<svg><path ... /></svg>`;

const App = () => <InlineSvg data={svg} color="primary" size="medium" />;
```

The component accepts the same props as the `<*Icon>` components `color` and `size`. Additionally it requires the `data` prop, which is the actual SVG content.

### XSS protection

The `data` passed to the component is run through a DOM sanitizer to prevent unwanted XSS injections.

### Where to use

This component can be used whenever the icon has to be rendered dynamically on runtime. For example in the Merchant Center this can be the case for the navigation menu icons, etc.

## Leading Icon

The leading icon is a an eye-catching visual element that should be used when an additional visual prominence is needed for a content section in the UI. The different colours in combination with the icons can be utilised to create certain categorisation of the elements in the UI.

The component is exported as a separate entry point:

```js
import LeadingIcon from '@commercetools-uikit/icons/leading-icon';
```

### Usage

```js
import LeadingIcon from '@commercetools-uikit/icons/leading-icon';
import { ExportIcon } from '@commercetools-uikit/icons';

const app = () => <LeadingIcon icon={<ExportIcon />} />;
```

### Properties

| Props        | Type           | Required | Values                                                       | Default   | Description                                                                                                                 |
| ------------ | -------------- | :------: | ------------------------------------------------------------ | --------- | --------------------------------------------------------------------------------------------------------------------------- |
| `size`       | `string`       |          | '10', '20', '30', '40'                                       | '20'      | Specifies the icon size                                                                                                     |
| `color`      | `string`       |          | 'accent', 'brown', 'neutral', 'purple', 'turquoise', 'white' | 'neutral' | Specifies the icon's background color and fill color                                                                        |
| `isInverted` | `boolean`      |          | `true`, `false`                                              | `false`   | Specifies whether the icon has a light background and dark fill (`false`), or dark background and light fill (`true`)       |
| `icon`       | `ReactElement` |          | UI Kit `<Icon/>` component                                   |           | Icon that is displayed within the component, you must supply a child icon with with this prop or the `svg` prop             |
| `svg`        | `string`       |          | A custom SVG to display                                      |           | Icon that is displayed using the `InlineSvg` component, you must supply a child icon with with this prop or the `icon` prop |

### Where to use

This component can be used wherever it is necessary to display a themed icon.

## Custom Icon

This component is meant to be used whenever consumers need to render an icon which is not part of the [ui-kit icon set](https://uikit.commercetools.com/?path=/story/components-icons--all-icons).

In order to keep visual consistency, we want to keep the available sizes of all icons equal. Bear in mind we would expect custom SVG icons to not contain size attributes so it can be controlled based on the components size attribute.

The component is exported as a separate entry point:

```js
import CustomIcon from '@commercetools-uikit/icons/custom-icon';
```

### Usage

```js
import CustomIcon from '@commercetools-uikit/icons/custom-icon';
import { YourCustomIcon } from './your-custom-icon-directory';

const app = () => <Icon icon={<YourCustomIcon />} />;
```

### Properties

| Props       | Type                                                      | Required | Values                                              | Default | Description                                     |
| ----------- | --------------------------------------------------------- | :------: | --------------------------------------------------- | ------- | ----------------------------------------------- |
| `size`      | `string`                                                  |          | '10', '20', '30', '40'                              | '20'    | Specifies the icon size                         |
| `icon`      | `union`<br/>Possible values:<br/>`, ReactElement, string` |    -     | A `ReactNode` or `string` that display a custom SVG |         | Icon displayed as a child of this component     |
| `hasBorder` | `boolean`                                                 |          | `true`, `false`                                     | `false` | Specifies whether the element displays a border |

---
_Source: https://npm.io/package/@commercetools-uikit/icons · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
