@blueprintjs/core
Version:
Core styles & components
48 lines (47 loc) • 1.61 kB
TypeScript
/// <reference types="react" />
import { IProps } from "../../common";
import { Panel } from "./panelTypes";
export interface PanelStack2Props<T> extends IProps {
/**
* The initial panel to show on mount. This panel cannot be removed from the
* stack and will appear when the stack is empty.
* This prop is only used in uncontrolled mode and is thus mutually
* exclusive with the `stack` prop.
*/
initialPanel?: Panel<T>;
/**
* Callback invoked when the user presses the back button or a panel
* closes itself with a `closePanel()` action.
*/
onClose?: (removedPanel: Panel<T>) => void;
/**
* Callback invoked when a panel opens a new panel with an `openPanel(panel)`
* action.
*/
onOpen?: (addedPanel: Panel<T>) => void;
/**
* If false, PanelStack will render all panels in the stack to the DOM, allowing their
* React component trees to maintain state as a user navigates through the stack.
* Panels other than the currently active one will be invisible.
*
* @default true
*/
renderActivePanelOnly?: boolean;
/**
* Whether to show the header with the "back" button in each panel.
*
* @default true
*/
showPanelHeader?: boolean;
/**
* The full stack of panels in controlled mode. The last panel in the stack
* will be displayed.
*/
stack?: Array<Panel<T>>;
}
interface PanelStack2Component {
<T>(props: PanelStack2Props<T>): JSX.Element | null;
displayName: string;
}
export declare const PanelStack2: PanelStack2Component;
export {};