You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| data-tooltip-wrapper | string | false |`div`|`div``span`| Element wrapper for the tooltip container, can be `div`, `span`, `p` or any valid HTML tag |
71
71
|~~data-tooltip-events~~|~~string~~|~~false~~|~~`hover`~~|~~`hover click``hover``click`~~|~~Events to watch for when handling the tooltip state~~ <br/>**DEPRECATED**<br/>Use `openOnClick` tooltip prop instead |
72
72
| data-tooltip-position-strategy | string | false |`absolute`|`absolute``fixed`| The position strategy used for the tooltip. Set to `fixed` if you run into issues with `overflow: hidden` on the tooltip parent container |
73
-
| data-tooltip-delay-show | number | false || any `number`| The delay (in ms) before showing the tooltip |
74
-
| data-tooltip-delay-hide | number | false || any `number`| The delay (in ms) before hiding the tooltip |
73
+
| data-tooltip-delay-show | number | false || any `number`| The delay (in ms) before showing the tooltip |
74
+
| data-tooltip-delay-hide | number | false || any `number`| The delay (in ms) before hiding the tooltip |
75
75
| data-tooltip-float | boolean | false |`false`|`true``false`| Tooltip will follow the mouse position when it moves inside the anchor element (same as V4's `effect="float"`) |
|`className`|`string`| no ||| Class name to customize tooltip element|
101
-
|`classNameArrow`|`string`| no ||| Class name to customize tooltip arrow element|
100
+
|`className`|`string`| no ||| Class name to customize tooltip element. You can also use the default class `react-tooltip` which is set internally|
101
+
|`classNameArrow`|`string`| no ||| Class name to customize tooltip arrow element. You can also use the default class `react-tooltip-arrow` which is set internally|
102
102
|`content`|`string`| no ||| Content to de displayed in tooltip (`html` prop is priorized over `content`) |
103
103
|~~`html`~~|~~`string`~~|~~no~~|||~~HTML content to de displayed in tooltip~~ <br/>**DEPRECATED**<br/>Use `children` or `render` instead |
104
104
|`render`|`function`| no ||| A function which receives a ref to the currently active anchor element and returns the content for the tooltip. Check the [examples](./examples/render.mdx)|
|`variant`|`string`| no |`dark`|`dark``light``success``warning``error``info`| Change the tooltip style with default presets |
111
111
|`wrapper`| HTML tag | no |`div`|`div``span``p` ... | Element wrapper for the tooltip container, can be `div`, `span`, `p` or any valid HTML tag |
112
112
|`children`| React node | no |`undefined`| valid React children | The tooltip children have lower priority compared to the `content` prop and the `data-tooltip-content` attribute. Useful for setting default content |
113
-
|~~`events`~~|~~`string[]`~~|~~no~~|~~`hover`~~|~~`hover``click`~~|~~Events to watch for when handling the tooltip state~~ <br/>**DEPRECATED**<br/>Use `openOnClick` tooltip prop instead |
113
+
|~~`events`~~|~~`string[]`~~|~~no~~|~~`hover`~~|~~`hover``click`~~|~~Events to watch for when handling the tooltip state~~ <br/>**DEPRECATED**<br/>Use `openOnClick` tooltip prop instead |
114
114
|`openOnClick`|`boolean`| no |`false`|`true``false`| Controls whether the tooltip should open when clicking (`true`) or hovering (`false`) the anchor element |
115
115
|`positionStrategy`|`string`| no |`absolute`|`absolute``fixed`| The position strategy used for the tooltip. Set to `fixed` if you run into issues with `overflow: hidden` on the tooltip parent container |
116
116
|`delayShow`|`number`| no || any `number`| The delay (in ms) before showing the tooltip |
|`closeOnEsc`|`boolean`| no |`false`|`true``false`| Pressing escape key will close the tooltip |
122
122
|`style`|`CSSProperties`| no || a React inline style | Add inline styles directly to the tooltip |
123
123
|`position`|`{ x: number; y: number }`| no || any `number` value for both `x` and `y`| Override the tooltip position on the DOM |
124
-
|`isOpen`|`boolean`|no | handled by internal state |`true``false`| The tooltip can be controlled or uncontrolled, this attribute can be used to handle show and hide tooltip outside tooltip (can be used **without**`setIsOpen`) |
124
+
|`isOpen`|`boolean` no | handled by internal state |`true``false`| The tooltip can be controlled or uncontrolled, this attribute can be used to handle show and hide tooltip outside tooltip (can be used **without**`setIsOpen`) |
125
125
|`setIsOpen`|`function`| no ||| The tooltip can be controlled or uncontrolled, this attribute can be used to handle show and hide tooltip outside tooltip |
126
126
|`afterShow`|`function`| no ||| A function to be called after the tooltip is shown |
127
127
|`afterHide`|`function`| no ||| A function to be called after the tooltip is hidden |
Copy file name to clipboardExpand all lines: docs/docs/upgrade-guide/changelog-v4-v5.md
+1-2Lines changed: 1 addition & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -26,10 +26,9 @@ This resulted in a great improvement in performance, and made it easier for the
26
26
- Default Padding changed from `padding: 8px 21px;` to `padding: 8px 16px;`
27
27
- Exported module now is `Tooltip` instead of `ReactTooltip`
28
28
- If you already have a `Tooltip` component in your application and want to explicitly declare this as `ReactTooltip`, just `import { Tooltip as ReactTooltip } from "react-tooltip"`
29
-
- CSS import is now optional, so you can modify and/or add any styling to your floating tooltip element
30
29
-`data-for` attribute now is `data-tooltip-id`
31
30
-`data-tip` attribute now is `data-tooltip-content`
32
-
-`getContent` prop was removed. Instead, you can directly pass dynamic content to the `content` tooltip prop, or to `data-tooltip-content` in the anchor element
31
+
-`getContent` prop was removed. Instead, you can directly pass dynamic content to the `content` tooltip prop, or to `data-tooltip-content` in the anchor element, or use the new `render` tooltip prop
33
32
- Default behavior of tooltip now is equivalent to V4's `solid` effect, instead of `float`. The new `float` prop can be set to achieve V4's `effect="float"`. See [Options](../options.mdx) for more details
0 commit comments