@furystack/shades-common-components
Version:
Common UI components for FuryStack Shades
32 lines • 1.4 kB
TypeScript
import type { ViewTransitionConfig } from '@furystack/shades';
export type Tab = {
header: JSX.Element;
component: JSX.Element;
hash: string;
/** Whether this tab shows a close button. Only effective when onClose is provided on Tabs */
closable?: boolean;
};
export declare const Tabs: (props: {
tabs: Tab[];
containerStyle?: Partial<CSSStyleDeclaration>;
style?: Partial<CSSStyleDeclaration>;
onChange?: (page: number) => void;
/** When provided, tabs operate in controlled mode (URL hash is ignored) */
activeKey?: string;
/** Called when the active tab changes (receives the tab's hash) */
onTabChange?: (key: string) => void;
/** Visual style of the tab headers. Defaults to 'line' */
type?: "line" | "card";
/** Layout orientation. Defaults to 'horizontal' */
orientation?: "horizontal" | "vertical";
/** Called when a closable tab's close button is clicked */
onClose?: (key: string) => void;
/** Called when the add button is clicked (only shown when this callback is provided) */
onAdd?: () => void;
viewTransition?: boolean | ViewTransitionConfig;
} & Omit<Partial<HTMLElement>, "style"> & {
style?: Partial<CSSStyleDeclaration>;
} & {
ref?: import("@furystack/shades").RefObject<Element>;
}, children?: import("@furystack/shades").ChildrenList) => JSX.Element;
//# sourceMappingURL=tabs.d.ts.map