datui
Color scheme

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" with aria-modal="true", labelled by title (warns in development when it has no label) and described by description.
  • The anchor gets aria-describedby pointing 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 overlayLabel closes it on any click.

API

OnboardingTooltip

Spotlight hint for onboarding: points at an element and blocks the page until dismissed.

PropTypeDefaultDescription
children (required)ReactElement<unknown, string | JSXElementConstructor<any>>—The element the hint points at: one element that can hold a ref.
open (required)boolean—
appearanceTooltipAppearanceaccent
arrowOffsetnumber—Pin the arrow this far (px) from the bubble's start edge instead of pointing at the anchor center.
classNamestring—
crossOffsetnumber0Shift along the anchor edge in px.
descriptionReactNode—
disableFocusTrapbooleanfalseLet focus leave the hint.
hideArrowbooleanfalse
maxWidthstring | number220px tokenMax width as a CSS length.
offsetnumber8Distance from the anchor in px.
onClose(() => void)—Called on Escape and on any click outside the hint.
overlayLabelstringClose hintAccessible name of the full-screen layer that closes the hint.
placementPlacementbottom
restoreFocusbooleantrueReturn focus to the anchor's previously focused element on close.
titleReactNode—Labels the hint dialog.