UNPKG

react-elegant-ui

Version:

Elegant UI components, made by BEM best practices for react

55 lines (54 loc) 1.27 kB
import { Ref, FC, ReactNode } from 'react'; import { IComponentHTMLElement, IComponentWithAddonNodes } from '../../types/IComponent'; import './TabsMenu.css'; /** * Interface for tab object */ export interface TabItem { /** * Tab id */ id?: string; /** * Disabled tab */ disabled?: boolean; /** * Content of tab. For example text or link */ content?: ReactNode; } export interface ITabsMenuProps extends IComponentHTMLElement<HTMLDivElement>, IComponentWithAddonNodes { /** * Array of tab items. */ tabs: TabItem[]; /** * ID of active tab. */ activeTab?: string; /** * Callback to tab switching */ setActiveTab?: (id: string) => void; /** * Reference to active tab element */ activeTabRef?: Ref<HTMLLIElement>; /** * Array of references to tabs elements */ tabsRef?: Ref<HTMLLIElement>[]; /** * Orientation of list a tabs (for acessability). * * @internal * @default 'vertical' */ orientation?: 'horizontal' | 'vertical'; } export declare const cnTabsMenu: import("@bem-react/classname").ClassNameFormatter; /** * Component to create menu. */ export declare const TabsMenu: FC<ITabsMenuProps>;