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
1. Run `npm install` || `yarn` to install dependencies
8
+
2. You can test by: `yarn dev` to run dev mode, or you can run **docs** directly using root folder instead of NPM, for this, please check **docs section**.
9
+
10
+
### Docs
11
+
12
+
You still need step 1 from `ReactTooltip (root)` section.
13
+
Docs are commited using npm packages, but with this steps, you can use local ReactTooltip package build.
14
+
15
+
1. In **docs** folder, run `npm install` || `yarn` to install dependencies
16
+
2. In **root** folder (parent of docs folder), run `yarn build` to generate a production build (you can use `yarn build --watch` to always generate a new build when a file changes)
17
+
3. Change `package.json`:
18
+
19
+
From this:
20
+
```
21
+
"react": "18.2.0",
22
+
"react-dom": "18.2.0",
23
+
"react-tooltip": "5.0.0"
24
+
```
25
+
26
+
To this:
27
+
```
28
+
"react": "link:../node_modules/react",
29
+
"react-dom": "link:../node_modules/react-dom",
30
+
"react-tooltip": "link:.."
31
+
32
+
```
33
+
34
+
4. Run `yarn start` and open `localhost:3000` to see docs running locally.
35
+
36
+
OBS: do not commit this change or the docs will broken the deployment and will not be updated.
[aronhelser](https://github.com/aronhelser) Passive maintainer - accepting PRs and doing minor testing, but not fixing issues or doing active development.
You don't need `!important` anymore, you just need to know at least a bit about CSS Specificity ([MDN Docs](https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity) | [W3c Docs](https://www.w3schools.com/css/css_specificity.asp)).
39
70
Using CSS Specificity you can add a class with more specificity than the current used in tooltip and you can override or add new rules to the component style.
In this example, we are adding an extra level to the CSS classes, the following styles are the default one of Tooltip component when we write this docs:
So, if we only add new classes like the below, this will not work because this is the same level of specificity than the default dark variant as example, you can compare:
141
109
@@ -145,20 +113,9 @@ So, if we only add new classes like the below, this will not work because this i
145
113
background-color: rgb(0, 247, 255);
146
114
}
147
115
116
+
/** add next line only if you want to have tooltip arrow with a different background color from tooltip **/
148
117
.example.example-arrow {
149
-
background-color: rgb(0, 247, 255);
150
-
}
151
-
```
152
-
153
-
```css
154
-
.tooltip {
155
-
...;
156
-
}
157
-
158
-
.dark,
159
-
.dark.arrow {
160
-
background: var(--rt-color-dark);
161
-
color: var(--rt-color-white);
118
+
background-color: rgb(255, 0, 0);
162
119
}
163
120
```
164
121
@@ -170,8 +127,9 @@ So, to make this work as expected, we need to add a new more level like this one
170
127
background-color: rgb(0, 247, 255);
171
128
}
172
129
130
+
/** add next line only if you want to have tooltip arrow with a different background color from tooltip **/
| positionStrategy | 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 |
67
67
| delayShow | number | false || any `number`| tooltip show will be delayed in miliseconds by the amount of value |
68
68
| delayHide | number | false || any `number`| tooltip hide will be delayed in miliseconds by the amount of value |
69
+
| style | CSSProperties | false || any React inline style | add styles directly to the component by `style` attribute |
69
70
| getContent | function | false || (value: string) => string | a method available to parse, format or modify the given content of tooltip before show it |
70
71
| isOpen | boolen | false | 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`) |
71
72
| setIsOpen | function | false ||| the tooltip can be controlled or uncontrolled, this attribute can be used to handle show and hide tooltip outside tooltip |
0 commit comments