Tooltip

Component to show tooltip.

  • The tip is shown on mouse enter, and is hidden on mouse leave. The Tooltip doesn't support complex text or operations.
  • To provide an explanation of a button/text/operation. It's often used instead of the html title attribute.

Usage

The Tooltip component can be imported using

import { Tooltip } from '@tail-kit/tail-kit'

Default Tooltip

Editable Example

Tooltip with icon

Tooltip with Explicit Placement

Tooltip with Dark Background

Tooltip without Pointing Arrow

Tooltip Props

NameDescriptionDefault Value
title
Title shown in the tooltip
ReactNode
--
icon
Title shown in the tooltip
Element | undefined
--
placement
The default placement of the tooltip. If the default placement cannot be used because of constraints, the tooltip placement would be computed automatically. It can be one of `topLeft`, `top`, `topRight`, `left`, `right`, `bottomLeft`, `bottom` and `bottomRight`
string | undefined
right
inverted
Tooltip theme. When inverted, the tooltip content would be shown in dark background
boolean | undefined
--
tooltipCloseDelay
The delay in closing the tooltip on mouse leave. A delay is added so that the user can move over the tooltip content before being closed. If the delay is set to 0, it would close as soon as the mouse leaves, but the user cannot select the content present inside tooltip.
number | undefined
100
hideArrow
Whether a arrow pointing towards the trigger would be shown or not
boolean | undefined
--
children
Content for which the tooltip is to be shown
ReactElement<any, string | JSXElementConstructor<any>>
--
portalParent
parent of the portal container
HTMLElement | undefined
typeof window !== 'undefined' ? document.body : undefined