UNPKG

@hypothesis/frontend-shared

Version:

Shared components, styles and utilities for Hypothesis projects

22 lines (21 loc) 891 B
import type { IconComponent, PresentationalProps } from '../../types'; import type { ButtonProps } from '../input/Button'; type ComponentProps = { icon?: IconComponent; /** * Text string representing the content of the tab when selected. The tab * button will be sized to accommodate this string in bold text. This can * prevent tab jiggle. */ textContent?: string; selected?: boolean; size?: 'md' | 'custom'; variant?: 'text' | 'tab' | 'custom'; unstyled?: boolean; }; export type TabProps = PresentationalProps & Omit<ButtonProps, 'variant' | 'size' | 'unstyled'> & ComponentProps; /** * Render a button with appropriate ARIA tab affordances */ export default function Tab({ children, classes, elementRef, icon: Icon, textContent, selected, size, variant, unstyled, ...htmlAttributes }: TabProps): import("preact").JSX.Element; export {};