Skip to content

Commit c53afc2

Browse files
committed
docs: add a working example into the getting started
1 parent 9d89169 commit c53afc2

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

docs/docs/getting-started.md renamed to docs/docs/getting-started.mdx

+30
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,33 @@ This docs is related to V5, [if you are using V4 please check here](https://reac
88

99
A react tooltip is a floating react element that displays information related to an anchor element when it receives keyboard focus or the mouse hovers over it.
1010

11+
import { Tooltip } from 'react-tooltip'
12+
import 'react-tooltip/dist/react-tooltip.css'
13+
14+
export const TooltipAnchor = ({ children, id, ...rest }) => {
15+
return (
16+
<span
17+
id={id}
18+
style={{
19+
display: 'flex',
20+
justifyContent: 'center',
21+
alignItems: 'center',
22+
width: '60px',
23+
height: '60px',
24+
borderRadius: '60px',
25+
color: '#222',
26+
background: 'rgba(255, 255, 255, 1)',
27+
cursor: 'pointer',
28+
boxShadow: '3px 4px 3px rgba(0, 0, 0, 0.5)',
29+
border: '1px solid #333',
30+
}}
31+
{...rest}
32+
>
33+
{children}
34+
</span>
35+
)
36+
}
37+
1138
## Installation
1239

1340
```bash
@@ -68,3 +95,6 @@ import ReactTooltip from 'react-tooltip'
6895
```jsx
6996
<ReactTooltip anchorId="my-anchor-element" />
7097
```
98+
99+
<TooltipAnchor id="props-basic">◕‿‿◕</TooltipAnchor>
100+
<Tooltip anchorId="props-basic" content="hello world!" />

0 commit comments

Comments
 (0)