Skip to main content
Brand and assets
Build
Monitor and contribute
/
Component library
  • All components
  • Buttons & actions
  • Forms & inputs
  • Layout & containers
  • Overlays
    • BottomSheet
    • DialogBox
    • DropdownMenu
    • Modal
    • Popover
    • Screen
    • SidebarModal
    • Tooltip
  • Feedback & status
  • Data display
  • Typography
  • Accessibility
  • Contrib
  • Deprecated
  • Overlays
  • Tooltip

Tooltip

A short floating label explaining an element. Nothing in it can be clicked, so never put an action there.

Health
Component health
Source
View on Github
Design
View Figma
Storybook
View in Storybook
Playground
No Example
Accessibility

not-compliant

Platform
Web
Accessibility issues
the keyboard navigation is not supported.
  • Overview
  • Props
  • Figma

Usage​

Hover me

Placement​

Inline​

By default, tooltip triggers are rendered as flex elements. If they are inside a Text element, they will be inline instead.

It's also possible to control this behavior through the inline prop.

Stantler’s magnificent antlers were traded at high prices as works of art. As a result, this Pokémon was hunted close to extinction by those who were after the priceless antlers.

When visiting a junkyard
, you may catch sight of it having an intense fight with Murkrow over shiny objects.Ho-Oh’s feathers glow in seven colors depending on the angle at which they are struck by light. These feathers are said to bring happiness to the bearers. This Pokémon is said to live at the foot of a rainbow.

Controlled​

If you need to control the tooltip visibility (instead of it being controlled by hover/focus), you can use the open prop.

Custom label​

While tooltips should only be used for short text (a few words), it is sometimes useful to customize what they render. When doing so, hust use <Text /> component to render text inside that custom label and get expected styling:

Hover me

Accessibility​

Adheres to the WAI-ARIA Tooltip Pattern.

Playground​

Loading...

Tooltip props

NameTypeDefault ValueDescriptionUsage count
asChildbooleanundefinedfalseInstead of wrapping the child, apply styles and accessibility attributes to it
children*ReactNodeTarget element that will trigger the tooltip on hover when uncontrolled
inlinebooleanundefinedSet if tooltip is attached to an inline element. Defaults to `true` when inside a Text element
label*
3 possibilitiesstringReactElement<unknown, stringJSXElementConstructor<any>>
Tooltip label. When passing something more complex than a string, React components can be used
onOpenChange((open: boolean) => void)undefinedCalled when tooltip is opened or closed
openbooleanundefinedWhen controlled, decide if tooltip should be visible or not
placementPlacementundefinedTooltip placement relative to target element
Edit this page
Previous
SidebarModal
Next
AlertNext
  • Usage
  • Placement
  • Inline
  • Controlled
  • Custom label
  • Accessibility
  • Playground