SegmentedControl Icon Options
You can enhance the content of the SegmentedControl items by displaying SVG icons, font icons, or a combination of icons and text.
The SegmentedControl items support 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.
As of R2 2023 (
v13.0.0) the default icon type in the Kendo UI for Angular components and Kendo UI themes is changed fromfonttosvg. Set thesvgIconproperty, or Continue Using Font Icons.
The following example demonstrates icon and text items, as well as icon-only items with tooltips for accessibility.
SVG Icons
To display an SVG icon inside a SegmentedControl item, set the svgIcon property to the necessary SVGIcon.
import { searchIcon } from '@progress/kendo-svg-icons';
public items = [{ text: 'Search', svgIcon: searchIcon }];
The following example demonstrates how to render SVG icons inside the SegmentedControl items.
Font Icons
To display a Font icon inside the SegmentedControl item:
- Use the
ICON_SETTINGStoken of the Icons package and set the icon type tofont. For more information, go to the topic about icon settings. - Set the
iconproperty of the item to the name of a font icon.tspublic items = [{ text: 'Search', icon: 'search' }];
The following example demonstrates how to render font icons inside the SegmentedControl items.
End Icon
To display an icon after the SegmentedControl item text, use the following options:
endSvgIcon—Sets anSVGIconafter the item text.endIcon—Sets a font icon from the Kendo UI theme after the item text. To render font icons, set the icon type tofont.
<kendo-segmented-control
[items]="endIconItems">
</kendo-segmented-control>You can also combine the end icon with a custom leading icon configured through the svgIcon or icon property.
The following example demonstrates how to display end icons on the SegmentedControl items by setting the endSvgIcon and endIcon properties.