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
`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.
123
132
124
-
Use `overlayColor`, `highlightBorderColor`, `highlightBorderRadius`, `zIndex`, and `infoBoxWidth` to match the built-in UI to your product without changing the overlay, highlight, or info box structure. When omitted, the existing defaults remain in place.
133
+
Global `options` still define the shared tutorial chrome. Use them for shared defaults such as `overlayColor`, `highlightBorderColor`, `highlightBorderRadius`, `infoBoxHeight`, `infoBoxWidth`, `infoBoxMargin`, `labels`, and `zIndex`.
125
134
126
-
Use `labels` to override the built-in button text. The default labels are `이전`, `다음`, `건너뛰기`, and `완료`.
135
+
Use `step.options` when a single step needs different `infoBoxHeight`, `infoBoxWidth`, `infoBoxMargin`, `highlightBorderColor`, `highlightBorderRadius`, or partial `labels`. The fallback order is `step.options` -> global `options` -> built-in defaults. Omitted label keys also follow that order.
136
+
137
+
`infoBoxAlignment` remains a step field, and `overlayColor` remains global-only so the backdrop stays consistent across the tutorial run.
127
138
128
139
Keyboard navigation is enabled by default while the overlay is open:
Copy file name to clipboardExpand all lines: packages/document/src/pages/docs/tutorial-overlay.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,9 +28,9 @@ Because `tutorial.open()` returns a Promise, you can keep `<TutorialOverlay />`
28
28
29
29
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.
30
30
31
-
Visual customization stays global for now. Use `options.overlayColor`, `options.highlightBorderColor`, `options.highlightBorderRadius`, `options.zIndex`, and `options.infoBoxWidth` when you need the built-in overlay UI to better match your product chrome.
31
+
Tutorial-level `options` still define the shared defaults for the overlay run. Use `step.options` when a single step needs different `infoBoxHeight`, `infoBoxWidth`, `infoBoxMargin`, `highlightBorderColor`, `highlightBorderRadius`, or partial `labels`.
32
32
33
-
Use `options.labels` to replace the built-in `이전`, `다음`, `건너뛰기`, and `완료` button text without replacing the UI itself.
33
+
The fallback order is `step.options` -> tutorial `options` -> built-in defaults. `overlayColor` remains global-only so the backdrop stays visually consistent across steps.
34
34
35
35
By default, the mounted overlay listens for `Escape`, `ArrowLeft`, and `ArrowRight` while it is open. You can disable that with `options.keyboardNavigation = false`.
- `highLightPadding`: expands the highlight frame around the target in pixels. Defaults to `8`.
108
-
- `infoBoxHeight`: sets the info box height in pixels.
109
-
- `infoBoxWidth`: sets the info box width with a CSS length such as `360` or `'24rem'`. Defaults to `'20rem'`.
110
-
- `infoBoxMargin`: controls the vertical gap between the target and the info box.
124
+
- `infoBoxHeight`: sets the default info box height in pixels and can be overridden per step.
125
+
- `infoBoxWidth`: sets the default info box width with a CSS length such as `360` or `'24rem'`. Defaults to `'20rem'` and can be overridden per step.
126
+
- `infoBoxMargin`: controls the default vertical gap between the target and the info box and can be overridden per step.
111
127
- `overlayColor`: sets the backdrop color. Defaults to `rgba(0, 0, 0, 0.5)`.
112
-
- `highlightBorderColor`: sets the highlight border color. Defaults to `#ff0000`.
113
-
- `highlightBorderRadius`: sets the highlight border radius with a CSS length. Defaults to the current padding-based radius.
128
+
- `highlightBorderColor`: sets the default highlight border color. Defaults to `#ff0000` and can be overridden per step.
129
+
- `highlightBorderRadius`: sets the default highlight border radius with a CSS length. Defaults to the current padding-based radius and can be overridden per step.
114
130
- `zIndex`: sets the overlay stack level. Defaults to `9999`.
115
-
- `labels`: overrides the built-in `prev`, `next`, `skip`, and `done` button labels.
131
+
- `labels`: overrides the built-in `prev`, `next`, `skip`, and `done` button labels by default and can be partially overridden per step.
116
132
- `keyboardNavigation`: enables `Escape`, `ArrowLeft`, and `ArrowRight` shortcuts while the overlay is open. Defaults to `true`.
117
133
- `closeOnOverlayClick`: closes the tutorial when the backdrop itself is clicked. Defaults to `false`.
118
134
- `onClose`: runs when the active tutorial is closed, including replacement by a newer `tutorial.open()` call.
119
135
120
136
Keyboard shortcuts are ignored while an `input`, `textarea`, `select`, or `contenteditable` element has focus.
121
137
The info box automatically repositions itself to stay within the viewport when the target is close to an edge.
138
+
Step customization resolves in this order: `step.options` -> tutorial `options` -> built-in defaults. `overlayColor`, `highLightPadding`, `keyboardNavigation`, `closeOnOverlayClick`, `zIndex`, and `onClose` stay global for the whole run.
122
139
When a tutorial opens, focus moves into the labeled dialog UI and returns to the previously active element after close. The current overlay does not trap focus.
123
140
`onClose` remains available for side effects, while the Promise returned by `tutorial.open()` is the async completion hook.
0 commit comments