Skip to content

Commit d390bdb

Browse files
docs: hidden prop and data attribute
1 parent 88357ab commit d390bdb

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

docs/docs/options.mdx

+4-2
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ import 'react-tooltip/dist/react-tooltip.css';
7373
| data-tooltip-delay-show | number | false | | any `number` | The delay (in ms) before showing the tooltip |
7474
| 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"`) |
76+
| data-tooltip-hidden | boolean | false | `false` | `true` `false` | Tooltip will not be shown |
7677

7778
### Props
7879

@@ -98,7 +99,7 @@ import 'react-tooltip/dist/react-tooltip.css'
9899
| name | type | required | default | values | description |
99100
| ------------------ | -------------------------- | --------- | ------------------------- | ------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
100101
| `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+
| `classNameArrow` | `string` | no | | | Class name to customize tooltip arrow element. You can also use the default class `react-tooltip-arrow` which is set internally |
102103
| `content` | `string` | no | | | Content to de displayed in tooltip (`html` prop is priorized over `content`) |
103104
| ~~`html`~~ | ~~`string`~~ | ~~no~~ | | | ~~HTML content to de displayed in tooltip~~ <br/>**DEPRECATED**<br/>Use `children` or `render` instead |
104105
| `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) |
@@ -116,12 +117,13 @@ import 'react-tooltip/dist/react-tooltip.css'
116117
| `delayShow` | `number` | no | | any `number` | The delay (in ms) before showing the tooltip |
117118
| `delayHide` | `number` | no | | any `number` | The delay (in ms) before hiding the tooltip |
118119
| `float` | `boolean` | no | `false` | `true` `false` | Tooltip will follow the mouse position when it moves inside the anchor element (same as V4's `effect="float"`) |
120+
| `hidden` | `boolean` | no | `false` | `true` `false` | Tooltip will not be shown |
119121
| `noArrow` | `boolean` | no | `false` | `true` `false` | Tooltip arrow will not be shown |
120122
| `clickable` | `boolean` | no | `false` | `true` `false` | Allow interaction with elements inside the tooltip. Useful when using buttons and inputs |
121123
| `closeOnEsc` | `boolean` | no | `false` | `true` `false` | Pressing escape key will close the tooltip |
122124
| `style` | `CSSProperties` | no | | a React inline style | Add inline styles directly to the tooltip |
123125
| `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`) |
126+
| `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`) |
125127
| `setIsOpen` | `function` | no | | | The tooltip can be controlled or uncontrolled, this attribute can be used to handle show and hide tooltip outside tooltip |
126128
| `afterShow` | `function` | no | | | A function to be called after the tooltip is shown |
127129
| `afterHide` | `function` | no | | | A function to be called after the tooltip is hidden |

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

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ If you run into any problems with the tooltip not updating after changes are mad
4848
- [x] `setIsOpen` - `function` (to control tooltip state) - if not used, tooltip state will be handled internally
4949
- [x] `position` - `{ x: number; y: number }` - similar to V4's `overridePosition`
5050
- [x] `float` - `boolean` - used to achieve V4's `effect="float"`
51+
- [x] `hidden` - `boolean` - when set, the tooltip will not show
5152
- [x] `render` - `function` - can be used to render dynamic content based on the active anchor element (check [the examples](../examples/render.mdx) for more details)
5253

5354
## `V4` props available in `V5`

0 commit comments

Comments
 (0)