DocsBlog

Get Started

Components

Data Grid

Signals

Styling

Theming

↑↓Navigate
↵Select
EscClose
  • 1.8.0

  • Day

    Night

    Preview

    Switch mode
  • cerberus

    acheron

    elysium

    oceanus

Get Started
Components
Data Grid
Signals
Styling
Theming

Concepts

OverviewCompositionCerberus ContextTesting

Layout

Aspect RatioBleedBoxCenterContainerContainer QueryDividerFlexFloatGridGroupLink OverlayScrollableStackWrap

Components

AccordionAdmonitionAvatarButtonCarouselCheckboxClipboardCollapsibleComboboxConfirm ModalCTA ModalDate PickerDialogFieldFieldsetFile UploaderIconButtonInputLoading StatesMarqueeMenuNotificationsNumber InputPaginationPin InputPopoverProgress IndicatorsPrompt ModalRadioRatingSelectSliderSplit ButtonSwitchTableTabsTagTextTextareaToggleTooltip

Utilities

Client OnlyDownload TriggerEnvironmentFeature FlagsFocus TrapForFormat ByteFormat NumberFormat Relative TimeFormat Relative TimeFrameHighlightJSON Tree ViewLocalePortalPresenceShowSwapsplitPropsTheme

Tooltip

A small pop-up box that appears when a user hovers over an element.

  • npm
  • source
  • recipe
  • Ark
View as Markdown
Open this page in Markdown
Anthropic
Open in Claude
Ask questions about this page
OpenAI
Open in ChatGPT
Ask questions about this page

Import

import { Tooltip } from '@cerberus/react'

Usage

Loading example...

Positioning

You can position the tooltip relative to the target element using the position prop.

Loading example...

Primitives

You can utilize the primitive components or the css prop to customize the checkbox.

ComponentDescription
TooltipRootThe context provider for the Tooltip parts
TooltipTriggerThe focusable element that triggers the tooltip on hover
TooltipPositionerThe positioning container for the tooltip
TooltipContentThe content of the tooltip
TooltipArrowThe arrow container of the tooltip bubble
TooltipArrowTipThe tip of the arrow

Parts

The TooltipParts API is an Object containing the full family of components.

NameDescription
RootThe TooltipRoot component.
TriggerThe TooltipTrigger component.
PositionerThe TooltipPositioner component.
ContentThe TooltipContent component.
ArrowThe TooltipArrow component.
ArrowTipThe TooltipArrowTip component.

API

Root

Props

PropTypeRequiredDefaultDescription
aria-labelstringfalseundefinedCustom label for the tooltip.
closeDelaynumberfalse150The close delay of the tooltip.
closeOnClickbooleanfalsetrueWhether the tooltip should close on click
closeOnEscapebooleanfalsetrueWhether to close the tooltip when the Escape key is pressed.
closeOnPointerDownbooleanfalsetrueWhether to close the tooltip on pointerdown.
closeOnScrollbooleanfalsetrueWhether the tooltip should close on scroll
defaultOpenbooleanfalseundefinedThe initial open state of the tooltip when rendered.
Use when you don't need to control the open state of the tooltip.
defaultTriggerValuestringfalseundefinedThe initial trigger value when rendered.
Use when you don't need to control the trigger value.
disabledbooleanfalseundefinedWhether the tooltip is disabled
hideModeHideModefalse'display-none'How to hide content when mounted but not present.
- 'display-none': HTML hidden attribute. Effects stay alive.
- 'activity': React 19 <Activity mode="hidden">. Effects pause. Requires React 19+.
idstringfalseundefinedThe unique identifier of the machine.
idsPartial<{ trigger: string | ((value?: string | undefined) => string), content: string, arrow: string, positioner: string }>falseundefinedThe ids of the elements in the tooltip. Useful for composition.
immediatebooleanfalseundefinedWhether to synchronize the present change immediately or defer it to the next frame
interactivebooleanfalsefalseWhether the tooltip's content is interactive.
In this mode, the tooltip will remain open when user hovers over the content.
lazyMountbooleanfalsefalseWhether to enable lazy mounting
onExitCompleteVoidFunctionfalseundefinedFunction called when the animation ends in the closed state
onOpenChange(details: OpenChangeDetails) => voidfalseundefinedFunction called when the tooltip is opened.
onTriggerValueChange(details: TriggerValueChangeDetails) => voidfalseundefinedFunction called when the trigger value changes.
openbooleanfalseundefinedThe controlled open state of the tooltip
openDelaynumberfalse400The open delay of the tooltip.
positioningPositioningOptionsfalseundefinedThe user provided options used to position the popover content
presentbooleanfalseundefinedWhether the node is present (controlled by the user)
skipAnimationOnMountbooleanfalsefalseWhether to allow the initial presence animation.
triggerValuestringfalseundefinedThe controlled trigger value
unmountOnExitbooleanfalsefalseWhether to unmount on exit.

Arrow

Props

PropTypeRequiredDefaultDescription
asChildbooleanfalseundefinedUse the provided child element as the default rendered element, combining their props and behavior.

ArrowTip

Props

PropTypeRequiredDefaultDescription
asChildbooleanfalseundefinedUse the provided child element as the default rendered element, combining their props and behavior.

Content

Props

PropTypeRequiredDefaultDescription
asChildbooleanfalseundefinedUse the provided child element as the default rendered element, combining their props and behavior.

Data Attributes

AttributeDescription / Value
data-scopetooltip
data-partcontent
data-state"open" | "closed"
data-instant
data-placementThe placement of the content
data-sideThe side of the trigger that the content is positioned on

Positioner

Props

PropTypeRequiredDefaultDescription
asChildbooleanfalseundefinedUse the provided child element as the default rendered element, combining their props and behavior.

RootProvider

Props

PropTypeRequiredDefaultDescription
valueUseTooltipReturntrueundefinedundefined
hideModeHideModefalse'display-none'How to hide content when mounted but not present.
- 'display-none': HTML hidden attribute. Effects stay alive.
- 'activity': React 19 <Activity mode="hidden">. Effects pause. Requires React 19+.
immediatebooleanfalseundefinedWhether to synchronize the present change immediately or defer it to the next frame
lazyMountbooleanfalsefalseWhether to enable lazy mounting
onExitCompleteVoidFunctionfalseundefinedFunction called when the animation ends in the closed state
presentbooleanfalseundefinedWhether the node is present (controlled by the user)
skipAnimationOnMountbooleanfalsefalseWhether to allow the initial presence animation.
unmountOnExitbooleanfalsefalseWhether to unmount on exit.

Trigger

Props

PropTypeRequiredDefaultDescription
asChildbooleanfalseundefinedUse the provided child element as the default rendered element, combining their props and behavior.
valuestringfalseundefinedThe value that identifies this specific trigger

Data Attributes

AttributeDescription / Value
data-scopetooltip
data-parttrigger
data-valueThe value of the item
data-currentPresent when current
data-expandedPresent when expanded
data-state"open" | "closed"

Context

API:

PropertyTypeDescription
openbooleanWhether the tooltip is open.
setOpen(open: boolean) => voidFunction to open the tooltip.
triggerValuestring | nullThe trigger value
setTriggerValue(value: string | null) => voidFunction to set the trigger value
reposition(options?: Partial<PositioningOptions>) => voidFunction to reposition the popover

Accessibility

Complies with the Tooltip WAI-ARIA design pattern.

Keyboard Support

KeyDescription
TabOpens/closes the tooltip without delay.
EscapeIf open, closes the tooltip without delay.

On this page

  • Import
  • Usage
  • Positioning
  • Primitives
    • Parts
  • API
    • Root
      • Props
    • Arrow
      • Props
    • ArrowTip
      • Props
    • Content
      • Props
      • Data Attributes
    • Positioner
      • Props
    • RootProvider
      • Props
    • Trigger
      • Props
      • Data Attributes
    • Context
  • Accessibility
    • Keyboard Support
Edit this page on Github
Get information from something that has a very long description.
Top position
Right position
Bottom position
Left position