This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@material/tab) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Tab
Tabs organize and allow navigation between groups of content that are related and at the same level of hierarchy.
Each Tab governs the visibility of one group of content.
Activates the indicator. previousIndicatorClientRect is an optional argument.
deactivate() => void
Deactivates the indicator.
focus() => void
Focuses the tab.
computeIndicatorClientRect() => ClientRect
Returns the bounding client rect of the indicator.
computeDimensions() => MDCTabDimensions
Returns the dimensions of the Tab.
Event Name
Event Data Structure
Description
MDCTab:interacted
{"detail": {"tab": MDCTab}}
Emitted when the Tab is interacted with, regardless of its active state. Used by parent components to know which Tab to activate.
Usage within Web Frameworks
If you are using a JavaScript framework, such as React or Angular, you can create a Tab 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.
MDCTabAdapter
Method Signature
Description
addClass(className: string) => void
Adds a class to the root element.
removeClass(className: string) => void
Removes a class from the root element.
hasClass(className: string) => boolean
Returns true if the root element contains the given class.
setAttr(attr: string, value: string) => void
Sets the given attribute on the root element to the given value.
Activates the tab. previousIndicatorClientRect is an optional argument.
deactivate() => void
Deactivates the tab.
computeIndicatorClientRect() => ClientRect
Returns the tab indicator subcomponent's content bounding client rect.
computeDimensions() => MDCTabDimensions
Returns the dimensions of the tab.
MDCTabFoundation Event Handlers
When wrapping the Tab component, it is necessary to register the following event handler. For an example of this, see the MDCTab component's initialSyncWithDOM method.