UNPKG

2.52 kBTypeScriptView Raw
1import * as React from "react";
2import { IconName } from "@blueprintjs/icons";
3import { AbstractPureComponent, Props } from "../../common";
4import { Position } from "../../common/position";
5import { MaybeElement } from "../../common/props";
6import { BackdropProps, OverlayableProps } from "../overlay/overlay";
7export declare enum DrawerSize {
8 SMALL = "360px",
9 STANDARD = "50%",
10 LARGE = "90%"
11}
12export interface DrawerProps extends OverlayableProps, BackdropProps, Props {
13 /** Drawer contents. */
14 children?: React.ReactNode;
15 /**
16 * Name of a Blueprint UI icon (or an icon element) to render in the
17 * drawer's header. Note that the header will only be rendered if `title` is
18 * provided.
19 */
20 icon?: IconName | MaybeElement;
21 /**
22 * Whether to show the close button in the dialog's header.
23 * Note that the header will only be rendered if `title` is provided.
24 *
25 * @default true
26 */
27 isCloseButtonShown?: boolean;
28 /**
29 * Toggles the visibility of the overlay and its children.
30 * This prop is required because the component is controlled.
31 */
32 isOpen: boolean;
33 /**
34 * Position of a drawer. All angled positions will be casted into pure positions
35 * (top, bottom, left, or right).
36 *
37 * @default "right"
38 */
39 position?: Position;
40 /**
41 * CSS size of the drawer. This sets `width` if horizontal position (default)
42 * and `height` otherwise.
43 *
44 * Constants are available for common sizes:
45 * - `DrawerSize.SMALL = 360px`
46 * - `DrawerSize.STANDARD = 50%`
47 * - `DrawerSize.LARGE = 90%`
48 *
49 * @default DrawerSize.STANDARD = "50%"
50 */
51 size?: number | string;
52 /**
53 * CSS styles to apply to the dialog.
54 *
55 * @default {}
56 */
57 style?: React.CSSProperties;
58 /**
59 * Title of the dialog. If provided, an element with `Classes.DIALOG_HEADER`
60 * will be rendered inside the dialog before any children elements.
61 */
62 title?: React.ReactNode;
63 /**
64 * Name of the transition for internal `CSSTransition`. Providing your own
65 * name here will require defining new CSS transition properties.
66 */
67 transitionName?: string;
68}
69export declare class Drawer extends AbstractPureComponent<DrawerProps> {
70 static displayName: string;
71 static defaultProps: DrawerProps;
72 render(): JSX.Element;
73 protected validateProps(props: DrawerProps): void;
74 private maybeRenderCloseButton;
75 private maybeRenderHeader;
76}