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
* do not delay show if tooltip is already shown ([#676](https://github.com/wwayne/react-tooltip/issues/676)) ([e8b9d84](https://github.com/wwayne/react-tooltip/commit/e8b9d84))
***styles:** add styles for shadow dom ([00d1539](https://github.com/wwayne/react-tooltip/commit/00d1539)), closes [#597](https://github.com/wwayne/react-tooltip/issues/597)
***build:** removing single quotes on cpy for windows shell ([#632](https://github.com/wwayne/react-tooltip/issues/632)) ([9c280af](https://github.com/wwayne/react-tooltip/commit/9c280af))
***showtooltip:** check if tooltipRef is undefined ([#623](https://github.com/wwayne/react-tooltip/issues/623)) ([f63eab2](https://github.com/wwayne/react-tooltip/commit/f63eab2))
Or see it on [Github Page](https://wwayne.github.io/react-tooltip/).
16
+
Or see it on [Github Page](https://wwayne.github.io/react-tooltip).
17
17
18
18
## Maintainers
19
19
@@ -39,12 +39,12 @@ yarn add react-tooltip
39
39
40
40
## Usage
41
41
42
-
**Using NPM**
42
+
### Using NPM
43
43
44
44
1 . Require react-tooltip after installation
45
45
46
46
```js
47
-
importReactTooltipfrom"react-tooltip";
47
+
importReactTooltipfrom'react-tooltip';
48
48
```
49
49
50
50
2 . Add data-tip = "your placeholder" to your element
@@ -55,11 +55,11 @@ import ReactTooltip from "react-tooltip";
55
55
56
56
3 . Include react-tooltip component
57
57
58
-
```js
58
+
```jsx
59
59
<ReactTooltip />
60
60
```
61
61
62
-
**Standalone**
62
+
### Standalone
63
63
64
64
You can import `node_modules/react-tooltip/dist/index.js` into your page. Please make sure that you have already imported `react` and `react-dom` into your page.
65
65
@@ -71,8 +71,6 @@ Notes:
71
71
- The option you set on `<ReactTooltip />` component will be implemented on every tooltip in a same page: `<ReactTooltip effect="solid" />`
72
72
- The option you set on a specific element, for example: `<a data-type="warning"></a>` will only affect this specific tooltip
The `html` option allows a tooltip to directly display raw HTML. This is a security risk if any of that content is supplied by the user. Any user-supplied content must be sanitized, using a package like [sanitize-html-react](https://www.npmjs.com/package/sanitize-html-react). We chose not to include sanitization after discovering it [increased our package size](https://github.com/wwayne/react-tooltip/issues/429) too much - we don't want to penalize people who don't use the `html` option.
109
+
The `html` option allows a tooltip to directly display raw HTML. This is a security risk if any of that content is supplied by the user. Any user-supplied content must be sanitized, using a package like [sanitize-html](https://www.npmjs.com/package/sanitize-html). We chose not to include sanitization after discovering it [increased our package size](https://github.com/wwayne/react-tooltip/issues/429) too much - we don't want to penalize people who don't use the `html` option.
112
110
113
-
#####Note:
111
+
#### Note
114
112
115
113
1.**data-tip** is necessary, because `<ReactTooltip />` finds the tooltip via this attribute
116
114
2.**data-for** corresponds to the **id** of `<ReactTooltip />`
@@ -122,7 +120,7 @@ The `html` option allows a tooltip to directly display raw HTML. This is a secur
122
120
123
121
> Hide the tooltip manually, the target is optional, if no target passed in, all existing tooltips will be hidden
0 commit comments