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
Copy file name to clipboardExpand all lines: README.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,7 @@ const App = () => {
49
49
},
50
50
],
51
51
options: {
52
+
highLightPadding:12,
52
53
infoBoxHeight:220,
53
54
infoBoxMargin:24,
54
55
keyboardNavigation:true,
@@ -73,6 +74,8 @@ const App = () => {
73
74
74
75
`content` is rendered as a plain string. HTML markup in the string is not interpreted.
75
76
77
+
`highLightPadding` expands the highlight frame around the target element. It defaults to `8` pixels and applies to the rendered highlight box as well as the info box anchor position.
78
+
76
79
Keyboard navigation is enabled by default while the overlay is open:
77
80
78
81
-`Escape` closes the tutorial.
@@ -83,6 +86,8 @@ Set `options.keyboardNavigation` to `false` to disable those shortcuts. Shortcut
83
86
84
87
Set `options.closeOnOverlayClick` to `true` to close the tutorial when the dimmed backdrop itself is clicked. Clicks on the highlight frame and info box do not trigger close.
85
88
89
+
The info box automatically flips and clamps itself to stay inside the viewport when the target sits close to an edge.
90
+
86
91
Mount `<TutorialOverlay />` once near the root of your app, then trigger `tutorial.open({ steps, options })` from any event handler or effect.
Copy file name to clipboardExpand all lines: packages/document/src/pages/docs/tutorial-overlay.mdx
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,10 @@ function App() {
24
24
25
25
`TutorialOverlay` does not need props for the current public API. Configure behavior through `tutorial.open({ steps, options })`.
26
26
27
+
The highlight frame uses `options.highLightPadding` to expand around the target. If you do not provide it, the overlay uses an `8px` padding by default.
28
+
27
29
By default, the mounted overlay listens for `Escape`, `ArrowLeft`, and `ArrowRight` while it is open. You can disable that with `options.keyboardNavigation = false`.
28
30
29
31
Backdrop clicks are ignored by default. Set `options.closeOnOverlayClick = true` if you want clicking the dimmed overlay area to close the tutorial.
32
+
33
+
The info box automatically flips and clamps itself to stay visible when the highlighted target sits near the viewport edges.
0 commit comments