Skip to content

Commit b2160bc

Browse files
docs: imperative mode open/close delay
1 parent eaf4964 commit b2160bc

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

docs/docs/examples/imperative-mode.mdx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ interface TooltipImperativeOpenOptions {
5050
* In practice, `ChildrenType` -> `React.ReactNode`
5151
*/
5252
content?: ChildrenType
53+
/**
54+
* Delay (in ms) before opening the tooltip.
55+
*/
56+
delay?: number
57+
}
58+
59+
interface TooltipImperativeCloseOptions {
60+
/**
61+
* Delay (in ms) before closing the tooltip.
62+
*/
63+
delay?: number
5364
}
5465

5566
interface TooltipImperativeProps {
@@ -83,7 +94,9 @@ The imperative methods <b>can</b> be applied alongside regular tooltip usage. Fo
8394
- `position` overrides the tooltip position. Behaves the same as the `position` tooltip prop
8495
- `place` overrides the tooltip placement relative to the anchor. Behaves the same as the `place` tooltip prop
8596
- `content` overrides the tooltip content
97+
- `delay` indicates how long (in ms) before the tooltip actually opens
8698
- `close()` closes the tooltip programatically
99+
- `delay` indicates how long (in ms) before the tooltip actually closes
87100

88101
#### Internal state
89102

src/components/Tooltip/TooltipTypes.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,16 @@ export interface TooltipImperativeOpenOptions {
5454
position?: IPosition
5555
place?: PlacesType
5656
content?: ChildrenType
57+
/**
58+
* @description Delay (in ms) before opening the tooltip.
59+
*/
5760
delay?: number
5861
}
5962

6063
export interface TooltipImperativeCloseOptions {
64+
/**
65+
* @description Delay (in ms) before closing the tooltip.
66+
*/
6167
delay?: number
6268
}
6369

0 commit comments

Comments
 (0)