• CMSnpm version

    • Overview
    • ContentBuilder
    • InviteUserForm
    • LoginForm
    • RenewPasswordForm
    • WysiwygInput
  • UInpm version

    • Overview
    • Accordion
    • AlertBubble
    • AnnouncementBar
    • Avatar
    • AvatarFileInput
    • Badge
    • Button
    • ButtonGroup
    • ButtonList
    • Calendar
    • Checkbox
    • CheckboxButton
    • CheckboxInput
    • CheckboxList
    • Chip
    • ColorRadio
    • ColorRadioGroup
    • Combobox
    • DatePicker
    • DatePickerInput
    • DateRangePicker
    • DateRangePickerInput
    • DatetimePicker
    • DatetimePickerInput
    • Dialog
    • Dropdown
    • Dropzone
    • ErrorMessage
    • FileInput
    • FlashMessages
    • FormComponent
    • Icon
    • IconButton
    • ImageGallery
    • InfoBox
    • Input
    • Label
    • Layout
    • Lightbox
    • ListItem
    • Loader
    • Lozenge
    • Menu
    • Message
    • Modal
    • ✅ ModalDialog
    • ✅ ModalHeader
    • MultiCombobox
    • MultiSelect
    • Pagination
    • Paper
    • Popover
    • Radio
    • RadioGroup
    • RasterImage
    • Select
    • Switch
    • ✅ Tabs
    • TextInput
    • TextLink
    • Textarea
    • TimePicker
    • TimePickerInput
    • Toggle
    • Tooltip
    • Typography
  • Formnpm version

    • Overview
    • AvatarFileInput
    • CheckboxButton
    • CheckboxInput
    • CheckboxList
    • ColorRadioGroup
    • Combobox
    • DatePickerInput
    • DateRangePickerInput
    • DatetimePickerInput
    • Dropzone
    • FileInput
    • Form
    • FormRenderer
    • GpsInput
    • MoneyInput
    • MultiCombobox
    • MultiSelect
    • NumberInput
    • PasswordInput
    • RadioGroup
    • Select
    • TextInput
    • Textarea
    • TimePickerInput
    • Toggle
  • DataGridnpm version

    • Overview
    • DataGrid
    • DataGridCustomExample
    • ExportButton
    • FilterList
    • Filters
    • FiltersButton
    • FulltextInput
    • HiddenColumns
    • HiddenColumnsButton
    • Pagination
    • RowCounts
    • RowsPerPageSelect
    • SelectedRowsToolbar
    • TableV2
    • ToolbarControl
    • ToolbarCustoms
    • ToolbarTabs
  • Wysiwygnpm version

    • Overview
  • Resizernpm version

    • Overview
  • Routernpm version

    • Overview
  • Corenpm version

    • Overview
  • Core-Reactnpm version

    • Overview
  • DnDnpm version

    • Overview
  • Page-Buildernpm version

    • Overview
  • Page-Builder-CMSnpm version

    • Overview
  • Page-Builder-Webnpm version

    • Overview
  • Sentrynpm version

    • Overview
  • Stylesnpm version

    • Overview
  • Localizenpm version

    • Overview
  • Analyticsnpm version

    • Overview
  • Datepickernpm version

    • Overview
  • Icons-generatornpm version

    • Overview
  • Smart-addressnpm version

    • Overview
  • E2Enpm version

    • Overview
  • E2E-Playwrightnpm version

    • Overview
View source on GitLab

Tooltip

A floating label shown on hover/focus of a reference element, positioned with @floating-ui/react and rendered in a portal with a pointing arrow.

When to use

Use Tooltip to reveal a short, non-interactive hint when the user hovers or focuses a control. It opens on hover (after a 200 ms delay) and on keyboard focus, and closes on blur, Escape, or pointer-out.

  • For a click-triggered panel that can hold interactive content, use Popover.
  • If content is falsy, the tooltip renders children unchanged (no wrapper, no floating element).

There is no @uxf/form twin.

Usage

import { Tooltip } from "@uxf/ui/tooltip";

<Tooltip content="My tooltip content" placement="top">
    <button type="button">Hover me</button>
</Tooltip>;

children must be a single element that accepts a ref and DOM props — it is cloned and used as the reference element.

Props

TooltipProps extends TooltipOptions (minus arrowRef).

PropTypeDefaultDescription
childrenReactElement—Required. Reference element. Cloned with the reference props; must forward a ref.
contentReactNode—Required. Tooltip content. If falsy, children is returned as-is.
placementPlacement"bottom" (floating-ui default)Preferred side; flip moves it when there is no room.
offsetnumber16Distance in px between reference and tooltip.
shiftPaddingnumber8Padding for the shift middleware (viewport edge gap).
isInteractivebooleantrueWhen false, drops the safePolygon bridge and pointer events: the tooltip closes on pointer-out and never blocks what it covers.
openDelaynumber200Hover delay in ms before opening. Focus opens at once.
isPointingDisabledbooleanfalseDeprecated. Same as isInteractive={false} with openDelay={0}.
classNamestring—Extra class on the floating element (added to uxf-tooltip).
styleCSSProperties—Extra styles merged onto the floating element.

Variants & states

  • Open triggers: hover (200 ms delay, openDelay) and focus. Closes on Escape, outside interaction, or blur.
  • Pointer bridge: by default a safePolygon lets the pointer move from the reference into the tooltip without closing it, as WCAG 2.1 SC 1.4.13 asks for hover content.
  • Non-interactive: isInteractive={false} makes the tooltip a pure overlay (uxf-tooltip--non-interactive, pointer-events: none). It closes as soon as the pointer leaves the reference, and a click on what it covers goes through. Use it where tooltips sit over dense, clickable UI and never hold anything to click or select.
  • Arrow: a rotated square arrow is positioned automatically against the resolved side.

Advanced: useTooltip

The useTooltip hook and its TooltipOptions type are exported for building custom floating elements. It wires up useFloating with offset/flip/shift/arrow middleware plus hover, focus, dismiss, and role interactions, and requires an arrowRef.

import { useTooltip } from "@uxf/ui/tooltip";

Requirements

Import the component stylesheet once in your global CSS:

@import url("@uxf/ui/css/tooltip.css");

Also requires the global @uxf/ui token layer, set up once per app — see @uxf/ui setup.

Default
Open in new tab