Skip to content

Commit b27e298

Browse files
docs: minor fixes
1 parent 72b4c4a commit b27e298

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

docs/docs/options.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ import 'react-tooltip/dist/react-tooltip.css';
7070
| data-tooltip-wrapper | string | false | `div` | `div` `span` | Element wrapper for the tooltip container, can be `div`, `span`, `p` or any valid HTML tag |
7171
| ~~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 |
7272
| 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 |
7575
| 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"`) |
7676

7777
### Props
@@ -97,8 +97,8 @@ import 'react-tooltip/dist/react-tooltip.css'
9797

9898
| name | type | required | default | values | description |
9999
| ------------------ | -------------------------- | --------- | ------------------------- | ------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
100-
| `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 |
102102
| `content` | `string` | no | | | Content to de displayed in tooltip (`html` prop is priorized over `content`) |
103103
| ~~`html`~~ | ~~`string`~~ | ~~no~~ | | | ~~HTML content to de displayed in tooltip~~ <br/>**DEPRECATED**<br/>Use `children` or `render` instead |
104104
| `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) |
@@ -110,7 +110,7 @@ import 'react-tooltip/dist/react-tooltip.css'
110110
| `variant` | `string` | no | `dark` | `dark` `light` `success` `warning` `error` `info` | Change the tooltip style with default presets |
111111
| `wrapper` | HTML tag | no | `div` | `div` `span` `p` ... | Element wrapper for the tooltip container, can be `div`, `span`, `p` or any valid HTML tag |
112112
| `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 |
114114
| `openOnClick` | `boolean` | no | `false` | `true` `false` | Controls whether the tooltip should open when clicking (`true`) or hovering (`false`) the anchor element |
115115
| `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 |
116116
| `delayShow` | `number` | no | | any `number` | The delay (in ms) before showing the tooltip |
@@ -121,7 +121,7 @@ import 'react-tooltip/dist/react-tooltip.css'
121121
| `closeOnEsc` | `boolean` | no | `false` | `true` `false` | Pressing escape key will close the tooltip |
122122
| `style` | `CSSProperties` | no | | a React inline style | Add inline styles directly to the tooltip |
123123
| `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`) |
125125
| `setIsOpen` | `function` | no | | | The tooltip can be controlled or uncontrolled, this attribute can be used to handle show and hide tooltip outside tooltip |
126126
| `afterShow` | `function` | no | | | A function to be called after the tooltip is shown |
127127
| `afterHide` | `function` | no | | | A function to be called after the tooltip is hidden |

docs/docs/upgrade-guide/changelog-v4-v5.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ This resulted in a great improvement in performance, and made it easier for the
2626
- Default Padding changed from `padding: 8px 21px;` to `padding: 8px 16px;`
2727
- Exported module now is `Tooltip` instead of `ReactTooltip`
2828
- 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
3029
- `data-for` attribute now is `data-tooltip-id`
3130
- `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
3332
- 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
3433

3534
## What about `ReactTooltip.rebuild()`?

0 commit comments

Comments
 (0)