Scrollable Tabs
The TabStrip allows you to scroll through its tabs when the tab list cannot fit in the component boundaries. It provides a rich API for customizing the scroll logic and the TabStrip appearance based on your preference.
Configuring Scrollable Tabs
To enable the scrolling of the tab list, configure the scrollable
option. It accepts both boolean
and ScrollableSettings
parameters. The default value of the scrollable
option is false
.
If you use a ScrollableSettings
parameter, the TabStrip enables you to configure the following options:
enabled
—Determines if the scrolling is initially enabled. The default value istrue
.scrollButtons
—Determines if scroll buttons will be displayed on both ends of the tab list.mouseScroll
—Specifies if the tab list scroll position can be changed by mouse scrolling. The default value istrue
.buttonScrollSpeed
—Sets the tab list scroll speed in pixels when clicking the scroll buttons. The default value is100px
.mouseScrollSpeed
—Sets the tab list scroll speed in pixels when scrolling via the mouse wheel. The default value is10px
.prevButtonIcon
—Allows specifying a custom icon for theprevious
scroll button.nextButtonIcon
—Allows specifying a custom icon for thenext
scroll button.
The following example demonstrates a scrollable TabStrip in action.
Configuring the Scroll Buttons Visibility
The TabStrip allows you to configure if scroll buttons will be displayed on both ends of the tab list. To customize this behavior, use the scrollButtons
option of the TabStrip ScrollableSettings
. This option accepts values of type TabStripScrollButtonsVisibility
, which are:
auto
(Default)—The scroll buttons will be automatically shown if the tabs do not fit inside the TabStrip boundaries, and hidden otherwise.visible
—The scroll buttons will be constantly visible. If the tabs fit inside the TabStrip boundaries, the buttons will be disabled.hidden
—The scroll buttons won't be displayed.
The following example demonstrates this option in action.
Configuring the Scroll Button Icons
The TabStrip allows you to change the default scroll button icons rendered in the tab list by using predefined and custom font icons or SVG 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 fromfont
tosvg
. Set thesvgIcon
property, or Continue Using Font Icons.
Using SVG Icons
To display SVG icons for the TabStrip scroll buttons, set the prevSVGButtonIcon and nextSVGButtonIcon properties of the TabStripScrollableSettings
to the necessary SVGIcon
. For details, go to the list of SVG icons supported by Kendo UI for Angular.
<kendo-tabstrip [scrollable]="settings"></kendo-tabstrip>
import {chevronLeftIcon, chevronRightIcon} from '@progress/kendo-svg-icons';
public settings:TabStripScrollableSettings = {
prevSVGButtonIcon: chevronLeftIcon,
nextSVGButtonIcon: chevronRightIcon,
};
The following example demonstrates how to display SVG scroll button icons.
Using Font Icons
To display Font icons inside the TabStrip scroll buttons:
-
Use the
ICON_SETTINGS
token of the Icons package and set the icon type tofont
. For more information, go to the topic about icon settings. -
Set the prevButtonIcon and nextButtonIcon options of the TabStrip ScrollableSettings. Both options accept a CSS class or multiple classes separated by spaces—this allows you to render font icons provided by Kendo UI for Angular and third-party icons like FontAwesome.
html<kendo-tabstrip [scrollable]="settings"></kendo-tabstrip>
tspublic settings: TabStripScrollableSettings = { prevButtonIcon: 'fa fa-arrow-circle-left', // FontAwesome icon nextButtonIcon: 'k-font-icon k-i-arrow-right' // Kendo UI font icon };
The following example demonstrates how to replace the default scroll button icons with a Kendo UI font icon class and a FontAwesome icon.
Configuring the Mouse Scroll
By default the tabs can be scrolled with mouse wheel (or touchpad, trackpad etc.). In order to disable this behavior, set the mouseScroll option of the TabStrip ScrollableSettings to false
.
The following example demonstrates how to conditionally enable or disable the mouse scrolling.
Adjusting the Scroll Speed
The TabStrip allows you to fine tune the scroll speed of the tabs. To adjust this behavior, utilize the following options of the TabStrip ScrollableSettings:
buttonScrollSpeed
—Sets the scroll speed in pixels when clicking the scroll buttons. The default value is100px
.mouseScrollSpeed
—Sets the scroll speed in pixels when scrolling via the mouse wheel. The default value is10px
.
The following example demonstrates how to set custom scroll speed.