DevExtreme jQuery/JS - Icons

Built-In Icon Library

DevExtreme includes an icon library with SVG and font icons for all DevExtreme themes. You can use an icon in UI components and in other page elements as is or customize it.

The following icons are available:

Embedded applications are not available for the selected DevExtreme version (v24.1).
We recommend that you upgrade to the most recent version of DevExtreme to access the latest features, bug fixes, and security updates.

You can find source icons in DevExtreme's GitHub repository:

Icons in DevExtreme UI Components

You can use icons in DevExtreme components that have an icon property. The following code snippet integrates icons from the built-in icon library into a Button component.

View Demo

Many default templates include the icon property. The following code snippet demonstrates the default item template of the ContextMenu component:

To find a list of UI components that support icons, search for "icon" in the left-hand menu.

Icons in Other HTML Elements

You can add DevExtreme icons to non-DevExtreme HTML elements. To do this, assign the dx-icon-IconName class to an element. We recommend using inline HTML elements such as <i> or <span>.

HTML
  • <i class="dx-icon-email"></i>

You can find icon names in the Built-In Icon Library article.

Customize Icons

DevExtreme icons are implemented as an icon font. You can customize icons with CSS styles specific to text content such as color, font-size, font-weight, and text-align.

DevExtreme UI components that generate icons assign the dx-icon class to all generated icons. Assign a unique id to a DevExtreme component and use it alongside the .dx-icon selector to customize all generated icons in a component simultaneously. To customize a specific generated icon, use a CSS selector with a specific icon class, such as .dx-icon-refresh. The following code snippet customizes both a specific icon and all generated icons in a Toolbar component:

To customize icons added to HTML elements, define a specific CSS class and assign styles to it.

HTML
CSS
  • <i class="dx-icon-email custom-icon-style"></i>
  • .custom-icon-style {
  • font-size: 24px;
  • color: blue;
  • }

Custom Images as Icons

Assign an image URL to the icon property of a DevExtreme UI component to implement a custom icon. You can also encode images in Base64 format to avoid additional HTTP requests at the cost of increased file sizes in your project.

You can assign Base64 code directly to a component's icon property or integrate it into a CSS style. We recommend the latter approach because of the Base64 string length.

The following code snippet demonstrates how you can specify Base64 images in CSS. Replace "customicon" in the .dx-icon-customicon selector with the value you assign to component icon properties:

CSS
  • .dx-icon-customicon {
  • background-image: url(data:image/png;base64,... LONG BASE64 CODE IS HERE ...);
  • background-repeat: no-repeat;
  • background-position: 0px 0px;
  • }

You can define specific icons for different UI component states. The following code snippet specifies a unique icon for selected tabs:

CSS
  • .dx-tab-selected .dx-icon-customicon {
  • background-image: url(data:image/png;base64,... LONG BASE64 CODE GOES HERE ...);
  • background-repeat: no-repeat;
  • background-position: 0px 0px;
  • }
NOTE
Classes like dx-tab-selected are not documented. Inspect CSS rules to determine which selectors you need to use.

External Icon Libraries

DevExtreme UI components generate icons as HTML <i> elements with icon class assignments. The following code snippet demonstrates how an icon appears in the DOM:

HTML
  • <i class="dx-icon dx-icon-home"></i>

DevExtreme UI components support external icon libraries that populate the DOM in the same way. Examples of such libraries include the following:

Follow the installation instructions of the library you want to integrate and set DevExtreme component icon properties as follows:

SVG Icons

In addition to font icons, DevExtreme supplies the same icons in the SVG format. You can find SVG icons in the DevExtreme repository on GitHub.

The following code uses SVG icons in the Button UI component. The same technique can be used with any other UI component that has the icon property.

  1. Use the icon's URL:

    JavaScript
    • new DevExpress.ui.dxButton(targetElement, {
    • icon: "https://path/to/the/icon.svg"
    • });

    This code wraps the SVG icon inside a <img /> tag. In this case, you cannot use CSS rules to customize the SVG image.

  2. Insert SVG content inline:

    JavaScript
    • new DevExpress.ui.dxButton(targetElement, {
    • icon: "<svg>SVG_CONTENT</svg>"
    • });

    This code renders SVG content directly in the markup. In this case, you can use CSS rules to customize the SVG image.

  3. Import the icon:

    JavaScript
    • import * as myIcon from "./assets/icon.svg";
    • new DevExpress.ui.dxButton(targetElement, {
    • icon: myIcon
    • });

    This code wraps the SVG icon inside a <img /> tag. In this case, you cannot use CSS rules to customize the SVG image.

IMPORTANT
The SVG format can contain executable code that might be malicious. We recommend that you use SVG icons from trusted sources only.