import cx from "classnames"; interface TabProps extends React.HTMLAttributes { /** Id of the tabpanel this tab controls. */ controls?: string; href?: string; /** Active state */ isActive?: boolean; /** Disabled state. */ isDisabled?: boolean; className?: string; children?: React.ReactNode; } const CLASS_TABLIST_ITEM = "tab-list__item"; const CLASS_TABLIST_TAB = "tab-list__tab"; const Tab: React.FC = ({ href, children, className, controls, isDisabled, isActive, ...other }) => { const tabClasses = cx(CLASS_TABLIST_TAB, className); const tabindex = isActive ? 0 : -1; const Tag = href ? "a" : "button"; return (
  • {children}
  • ); }; Tab.displayName = "Tab"; export { Tab };