UNPKG

@cimpress/react-components

Version:
42 lines 1.36 kB
import React, { ReactNode } from 'react'; import { PublicComponentProps } from './types'; export interface Tab { /** * Contents of the card that should be shown for that tab. */ block: ReactNode; /** * Footer is the (optional) card footer. */ footer?: ReactNode; /** * href can be optionally supplied for each tab link. */ href?: string; /** * Name of the tab. */ name: string; } export interface TabCardProps extends PublicComponentProps { /** * If provided, a callback function to be called when a tab has been selected. */ onSelect?: (e: any, selectedKey: number) => void; /** * If provided the internal state is overriden and your selected tab is based on this property. * * It is likely that if you are providing this value, you should pass in changes by providing `onSelect` and properly updating this property on changes of * the selected tab otherwise your clicking tabs will not properly change. */ selectedIndex?: number; /** * Array of tabs to display in the card. */ tabs: Tab[]; } /** * A Component implementing a card with internal tabs in the header */ export declare const TabCard: ({ selectedIndex, onSelect, tabs, ...rest }: TabCardProps) => React.JSX.Element; //# sourceMappingURL=TabCard.d.ts.map