Skip to content
This repository was archived by the owner on Nov 9, 2024. It is now read-only.

Commit 8076f2c

Browse files
committed
docs: add headless tippy notes
1 parent 55ffc49 commit 8076f2c

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ on it:
126126
For details on styling the arrow from scratch,
127127
[take a look at the Popper tutorial](https://popper.js.org/docs/v2/tutorial/#arrow).
128128

129+
**Note: your arrow must be an `HTMLElement` (not an `SVGElement`). To use an SVG
130+
arrow, wrap it in a `<div>` tag with the `data-popper-arrow` attribute.**
131+
129132
You may also pass a ref to the element directly without the attribute using a
130133
callback ref:
131134

@@ -146,7 +149,7 @@ function App() {
146149
{
147150
name: 'arrow',
148151
options: {
149-
element: arrow,
152+
element: arrow, // can be a CSS selector too
150153
},
151154
},
152155
],
@@ -169,6 +172,19 @@ element that the root popper node wraps, which is what gets styled and animated.
169172
For advanced cases, you can access the parent popper node as `instance.popper`
170173
in the `onCreate` lifecycle hook.
171174

175+
[Here's `moveTransition` with Framer Motion](https://codesandbox.io/s/tippyjs-react-framer-motion-j94mj).
176+
177+
##### iOS click outside
178+
179+
Add this to your CSS to enable click outsides to work on iOS:
180+
181+
```css
182+
.tippy-iOS {
183+
cursor: pointer !important;
184+
-webkit-tap-highlight-color: transparent;
185+
}
186+
```
187+
172188
### Component children
173189

174190
If you want to use a component element as a child, ensure you forward the ref to

0 commit comments

Comments
 (0)