UNPKG

@auraxy/react-tabs

Version:

tabs component for react app

45 lines (36 loc) 878 B
import React, { ReactNode } from 'react' interface TabValue { title: | string | ReactNode | ((currTab: TabValue, optionsForTab: any) => ReactNode) /** * 当值为函数时,表示内容为惰性加载 * */ content?: | string | ReactNode | ((currTab: TabValue, optionsForTab: any) => ReactNode) value: string | number | boolean disabled?: boolean } declare type TabsValue = TabValue interface ChangeArg { key: string | number | boolean index: number } interface BarProps { allTabs: HTMLLIElement[] currentIndex: number } interface TabsProps { onChange?(val: ChangeArg): void tabs: TabValue[] value?: string | number | boolean className?: string animation?: boolean optionsForTab?: any } declare const Tabs: React.FC<TabsProps> export default Tabs export { BarProps, ChangeArg, TabValue, TabsProps, TabsValue }