Search results

Icons Library

The Syncfusion React library provides the set of base64 formatted font icons, that can be utilized in the web application.

Steps to use Icons library

  1. Add the class name e-icons to the HTML element which needs to render the icon. This class contains the font-family and common property of font icons.

  2. Add the icon class with corresponding icon content from the available icons. For example, the below code snippet represents the search icon class.

    .e-search:before{
        content:'\e993';
    }
  3. Add e-icons and e-search class to the HTML element.

    <span class="e-icons e-search"></span>
  4. Add the CDN link reference of icons library in the ~index.html file.

    <link href="https://cdn.syncfusion.com/ej2/ej2-base/styles/material.css" rel="stylesheet" />

    The below code snippet represents the complete example of icon usage.

    import * as React from 'react';
    
    var icons = `
    .e-search:before {
        content:'\\e993';
    }
    .e-upload:before {
        content: '\\e725';
    }
    .e-font:before {
        content: '\\e34c';
    }
    `
    export default class App extends React.Component<{}, {}> {
        render() {
            var iconList = ['e-search', 'e-upload', 'e-font'];
            const listItems = iconList.map((icon, index) =>
                <li><span className={`e-icons ${icon}`} key={index}></span></li>
            );
    
            return (
                <div>
                    <style>{icons}</style>
                    <div className="icons">
                        <ul>
                            {listItems}
                        </ul>
                    </div>
                </div>
            );
        }
    }

Customization

The Syncfusion React icons library can be customize its color and size by overriding the e-icons class.

```tsx
import * as React from 'react';

var icons = `
.e-icons {
    color: #00ffff;
    font-size: 26px;
}
.e-search:before {
    content:'\\e993';
}
.e-upload:before {
    content: '\\e725';
}
.e-font:before {
    content: '\\e34c';
}
`
export default class App extends React.Component<{}, {}> {
    render() {
        var iconList = ['e-search', 'e-upload', 'e-font'];
        const listItems = iconList.map((icon, index) =>
            <li><span className={`e-icons ${icon}`} key={index}></span></li>
        );

        return (
            <div>
                <style>{icons}</style>
                <div className="icons">
                    <ul>
                        {listItems}
                    </ul>
                </div>
            </div>
        );
    }
}
```

Available Icons

The complete pack of Syncfusion React icons library are listed in the below table. The corresponding icon content can be referred in the content section.