Optional. Sets the elements inside the scroll content element to be aligned to the start of the scroll content element.
mdc-tab-scroller--align-end
Optional. Sets the elements inside the scroll content element to be aligned to the end of the scroll content element.
mdc-tab-scroller--align-center
Optional. Sets the elements inside the scroll content element to be aligned to the center of the scroll content element.
NOTE: The align modifier classes are only applicable when the contents do not meet or exceed the width of the Tab Scroller and Tab Bar (i.e., most commonly, when mdc-tab--min-width is used on each tab).
Sets the scroll animation duration and, optionally, the timing function.
MDCTabScroller Methods
Method Signature
Description
scrollTo(scrollX: number) => void
Scrolls to the scrollX value.
incrementScroll(scrollX: number) => void
Increments the current scroll value by the scrollX value using animation.
incrementScrollImmediate(scrollX: number) => void
Increments the current scroll value by the scrollX value without animation.
getScrollPosition() => number
Returns the current visual scroll position.
getScrollContentWidth() => number
Returns the width of the scroll content element.
Usage within Web Frameworks
If you are using a JavaScript framework, such as React or Angular, you can create a Tab Scroller for your framework. Depending on your needs, you can use the Simple Approach: Wrapping MDC Web Vanilla Components, or the Advanced Approach: Using Foundations and Adapters. Please follow the instructions here.