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.
Setup
To enable the scrolling of the tab list, set the scrollable
prop to true.
The TabStrip enables you to configure the following options:
mouseScrollSpeed
—Sets the tab list scroll speed in pixels when scrolling via the mouse wheel. The default value is10px
.buttonScrollSpeed
—Sets the tab list scroll speed in pixels when clicking the scroll buttons. The default value is100px
.prevButton
—Allows specifying a custom component for theprevious
scroll button.nextButton
—Allows specifying a custom component for thenext
scroll button.scrollButtonsPosition
—Sets the scroll buttons position according to the tab list.
The following example demonstrates a scrollable TabStrip in action.
Configuring the Scroll Buttons Position
By default, the TabStrip renders its scroll buttons on both ends of the tab list. To customize this behavior, use the scrollButtonsPosition
property of the TabStrip by passing the following values:
around
(Default)—The scroll buttons will be rendered on both sides of the tab list.before
—The scroll buttons will be rendered prior to the tab list.after
—The scroll buttons will be rendered after the tab list.
The following example demonstrates this in action.
Right-to-Left Support
The TabStrip allows you to change the direction of the content to right-to-left using its dir
property.