Overlays
OnboardingTooltip
Spotlight hint for onboarding: points at an element and blocks the page until dismissed.
import { OnboardingTooltip } from "datui";Examples
Basic
Accessibility
- Renders
role="dialog"witharia-modal="true", labelled bytitle(warns in development when it has no label) and described bydescription. - The anchor gets
aria-describedbypointing at the description while open. - Focus moves into the hint, is trapped (unless
disableFocusTrap) and returns to the previously focused element on close. - Escape closes it; a full-screen layer labelled by
overlayLabelcloses it on any click.
API
OnboardingTooltip
Spotlight hint for onboarding: points at an element and blocks the page until dismissed.
| Prop | Type | Default | Description |
|---|---|---|---|
| children (required) | ReactElement<unknown, string | JSXElementConstructor<any>> | — | The element the hint points at: one element that can hold a ref. |
| open (required) | boolean | — | |
| appearance | TooltipAppearance | accent | |
| arrowOffset | number | — | Pin the arrow this far (px) from the bubble's start edge instead of pointing at the anchor center. |
| className | string | — | |
| crossOffset | number | 0 | Shift along the anchor edge in px. |
| description | ReactNode | — | |
| disableFocusTrap | boolean | false | Let focus leave the hint. |
| hideArrow | boolean | false | |
| maxWidth | string | number | 220px token | Max width as a CSS length. |
| offset | number | 8 | Distance from the anchor in px. |
| onClose | (() => void) | — | Called on Escape and on any click outside the hint. |
| overlayLabel | string | Close hint | Accessible name of the full-screen layer that closes the hint. |
| placement | Placement | bottom | |
| restoreFocus | boolean | true | Return focus to the anchor's previously focused element on close. |
| title | ReactNode | — | Labels the hint dialog. |