UNPKG

2.52 kBTypeScriptView Raw
1import * as React from "react";
2import { AbstractPureComponent, type IntentProps } from "../../common";
3import { type PopoverInteractionKind } from "../popover/popover";
4import type { DefaultPopoverTargetHTMLProps, PopoverSharedProps } from "../popover/popoverSharedProps";
5export interface TooltipProps<TProps extends DefaultPopoverTargetHTMLProps = DefaultPopoverTargetHTMLProps> extends Omit<PopoverSharedProps<TProps>, "shouldReturnFocusOnClose">, IntentProps {
6 /**
7 * The content that will be displayed inside of the tooltip.
8 */
9 content: React.JSX.Element | string;
10 /**
11 * Whether to use a compact appearance, which reduces the visual padding around
12 * tooltip content.
13 *
14 * @default false
15 */
16 compact?: boolean;
17 /**
18 * The amount of time in milliseconds the tooltip should remain open after
19 * the user hovers off the trigger. The timer is canceled if the user mouses
20 * over the target before it expires.
21 *
22 * @default 0
23 */
24 hoverCloseDelay?: number;
25 /**
26 * The amount of time in milliseconds the tooltip should wait before opening
27 * after the user hovers over the trigger. The timer is canceled if the user
28 * mouses away from the target before it expires.
29 *
30 * @default 100
31 */
32 hoverOpenDelay?: number;
33 /**
34 * The kind of hover interaction that triggers the display of the tooltip.
35 * Tooltips do not support click interactions.
36 *
37 * @default PopoverInteractionKind.HOVER_TARGET_ONLY
38 */
39 interactionKind?: typeof PopoverInteractionKind.HOVER | typeof PopoverInteractionKind.HOVER_TARGET_ONLY;
40 /**
41 * Indicates how long (in milliseconds) the tooltip's appear/disappear
42 * transition takes. This is used by React `CSSTransition` to know when a
43 * transition completes and must match the duration of the animation in CSS.
44 * Only set this prop if you override Blueprint's default transitions with
45 * new transitions of a different length.
46 *
47 * @default 100
48 */
49 transitionDuration?: number;
50}
51/**
52 * Tooltip component.
53 *
54 * @see https://blueprintjs.com/docs/#core/components/tooltip
55 */
56export declare class Tooltip<T extends DefaultPopoverTargetHTMLProps = DefaultPopoverTargetHTMLProps> extends AbstractPureComponent<TooltipProps<T>> {
57 static displayName: string;
58 static defaultProps: Partial<TooltipProps>;
59 private popoverRef;
60 render(): React.JSX.Element;
61 reposition(): void;
62 private renderPopover;
63}