UNPKG

@material/react-tab-bar

Version:
38 lines (37 loc) 1.99 kB
import React from 'react'; import TabScroller from '@material/react-tab-scroller'; import Tab, { TabProps } from '@material/react-tab'; import { MDCTabBarFoundation } from '@material/tab-bar/foundation'; import { MDCTabBarAdapter } from '@material/tab-bar/adapter'; export interface TabBarProps extends React.HTMLAttributes<HTMLDivElement> { indexInView?: number; activeIndex: number; handleActiveIndexUpdate?: (index: number) => void; onActivated?: (index: number) => void; className?: string; isRtl?: boolean; children: React.ReactElement<TabProps> | React.ReactElement<TabProps>[]; } interface TabBarState { previousActiveIndex: number; } declare class TabBar extends React.Component<TabBarProps, TabBarState> { tabBarRef: React.RefObject<HTMLDivElement>; tabScrollerRef: React.RefObject<TabScroller>; tabList: Tab[]; foundation: MDCTabBarFoundation; constructor(props: TabBarProps); static defaultProps: Partial<TabBarProps>; componentDidMount(): void; componentDidUpdate(prevProps: TabBarProps): void; componentWillUnmount(): void; readonly classes: string; readonly adapter: MDCTabBarAdapter; pushToTabList: (el: Tab) => void; onKeyDown: (e: React.KeyboardEvent<HTMLDivElement>) => void; onClickTab: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>, index: number, onClick?: ((event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void) | undefined) => void; render(): JSX.Element; renderTab: (tab: React.ReactElement<TabProps, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>, index: number) => React.ReactElement<TabProps, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>; } export { Tab }; export default TabBar;