UNPKG

2.63 kBTypeScriptView Raw
1import * as React from 'react';
2import PropTypes from 'prop-types';
3import { TabsProps as BaseTabsProps } from '@restart/ui/Tabs';
4import { NavProps } from './Nav';
5import { TransitionType } from './helpers';
6export interface TabsProps extends Omit<BaseTabsProps, 'transition'>, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect'>, NavProps {
7 transition?: TransitionType;
8}
9declare const Tabs: {
10 (props: TabsProps): React.JSX.Element;
11 propTypes: {
12 /**
13 * Mark the Tab with a matching `eventKey` as active.
14 *
15 * @controllable onSelect
16 */
17 activeKey: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
18 /** The default active key that is selected on start */
19 defaultActiveKey: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
20 /**
21 * Navigation style
22 *
23 * @type {('tabs'| 'pills' | 'underline')}
24 */
25 variant: PropTypes.Requireable<string>;
26 /**
27 * Sets a default animation strategy for all children `<TabPane>`s.<tbcont
28 *
29 * Defaults to `<Fade>` animation, else use `false` to disable or a
30 * react-transition-group `<Transition/>` component.
31 *
32 * @type {Transition | false}
33 * @default {Fade}
34 */
35 transition: PropTypes.Requireable<NonNullable<boolean | PropTypes.ReactComponentLike | null | undefined>>;
36 /**
37 * HTML id attribute, required if no `generateChildId` prop
38 * is specified.
39 *
40 * @type {string}
41 */
42 id: PropTypes.Requireable<string>;
43 /**
44 * Callback fired when a Tab is selected.
45 *
46 * ```js
47 * function (
48 * Any eventKey,
49 * SyntheticEvent event?
50 * )
51 * ```
52 *
53 * @controllable activeKey
54 */
55 onSelect: PropTypes.Requireable<(...args: any[]) => any>;
56 /**
57 * Wait until the first "enter" transition to mount tabs (add them to the DOM)
58 */
59 mountOnEnter: PropTypes.Requireable<boolean>;
60 /**
61 * Unmount tabs (remove it from the DOM) when it is no longer visible
62 */
63 unmountOnExit: PropTypes.Requireable<boolean>;
64 /**
65 * Have all `Tabs`s proportionately fill all available width.
66 */
67 fill: PropTypes.Requireable<boolean>;
68 /**
69 * Have all `Tab`s evenly fill all available width.
70 */
71 justify: PropTypes.Requireable<boolean>;
72 };
73 displayName: string;
74};
75export default Tabs;