Search code examples
angularsvgkendo-ui

How to convert Font Awesome IconDefinition to Kendo UI SVGIcon


Kendo UI recently just moved to using SVG icons by default in their widgets (link), but their selection of icons is not very good. I would like to use FontAwesome icons instead, but they have different variable types. How can I do this?


Solution

  • I reached out to Telerik's support and they helped me:

    My Code

    import { SVGIcon } from '@progress/kendo-svg-icons';
    
    import { faHouse } from '@fortawesome/pro-regular-svg-icons';
    
    public faHouse: SVGIcon = {
        name: faHouse.iconName,
        content: `<path d="${faHouse.icon[4]}" />`,
        viewBox: `0 0 ${faHouse.icon[0]} ${faHouse.icon[1]}`,
    };
    

    Their Stackblitz Demo.