Material Components React Tab Indicator
npm install @material/react-tab-indicatorA React version of an MDC Tab Indicator.
```
npm install @material/react-tab-indicator
with Sass:
`js`
import '@material/react-tab-indicator/index.scss';
with CSS:
`js`
import '@material/react-tab-indicator/dist/tab-indicator.css';
#### With an Underline (default)
`js
import React from 'react';
import TabIndicator from '@material/react-tab-indicator';
class MyApp extends React.Component {
state = {active: false};
render() {
return (
#### With Icon
If you want the underline instead of an icon, pass the icon element as a child
of the Tab Indicator component.
`js
import React from 'react';
import TabIndicator from '@material/react-tab-indicator';
import MaterialIcon from '@material/react-material-icon';class MyApp extends React.Component {
state = {active: false};
render() {
return (
active={this.state.active}
icon
>
);
}
}
``Prop Name | Type | Description
--- | --- | ---
active | boolean | If true will activate the indicator.
className | string | Classes to appear on className attribute of root element.
fade | boolean | If enabled will use the fade animation for transitioning to other tabs.
icon | boolean | Indicates that the indicator is an icon instead of an underline.
previousIndicatorClientRect | ClientRect | The indicator's clientRect that was previously activated.
onTransitionEnd | function | transitionend event callback handler.
Sass mixins may be available to customize various aspects of the components. Please refer to the
MDC Web repository for more information on what mixins are available, and how to use them.
Please see our Best Practices doc when importing or using icon fonts.