SmartPasteButton Icon OptionsPremium
You can enhance the visual content of the SmartPasteButton by displaying SVG icons, font icons, or images. By default, the SmartPasteButton displays a clipboard with sparkle icon, but you can replace it to match your application design.
The SmartPasteButton supports the following icon options:
svgIcon—Displays an SVG icon. For available icons, refer to the list of SVG icons.icon—Displays a font icon from the Kendo UI theme. For available icons, refer to the list of font icons.iconClass—Displays an icon from a CSS class, such as a Font Awesome icon.imageUrl—Displays an image from a URL.
SVG Icons
To display an SVG icon, set the svgIcon property of the SmartPasteButton to the necessary SVGIcon.
import { sparklesIcon } from '@progress/kendo-svg-icons';
<SmartPasteButton svgIcon={sparklesIcon}>Smart Paste</SmartPasteButton>;
The following example demonstrates the default icon and a custom SVG icon.
Font Icons
To display a Font icon inside the SmartPasteButton:
- Load the font icons in your project so that the icon renders as expected.
- Depending on the font icons library, you can set the:
iconproperty to a font icon in the Kendo UI theme.tsx<SmartPasteButton icon="paste">Smart Paste</SmartPasteButton>;iconClassproperty to a third-party font icon library (such as FontAwesome).tsx<SmartPasteButton iconClass="fa fa-magic">Smart Paste</SmartPasteButton>;
Image URL
To display an image from a URL, set the imageUrl property of the SmartPasteButton.
<SmartPasteButton imageUrl="https://example.com/icons/settings.png">Smart Paste</SmartPasteButton>;
The following example demonstrates the font icon, icon class, and image URL options.
End Icon
To display an icon after the SmartPasteButton text, use the following props:
endSvgIcon—Sets an SVG icon after the SmartPasteButton text.endIcon—Sets a font icon from the Kendo UI theme after the SmartPasteButton text. To render font icons, set the icon type tofont.
The end icon does not replace the default paste icon. You can combine it with a custom leading icon configured through svgIcon or icon. The prefix and suffix props let you add custom React content before and after the button content.
The following example demonstrates how to set SVG and font icons after the text of the SmartPasteButton, and how to combine an end icon with a custom leading icon.