Skip to main content

Tooltip

The Tooltip component is a user interface element that provides additional information or context when users hover over or interact with an element on our application. It is a helpful tool for enhancing the user experience by providing supplementary details about specific elements. In this guide, we'll walk through how to use the Tooltip component in codebase.

Importing the Tooltip Component

To use the Tooltip component in our app, we need to import it from our styled components. Here's how we can import it:

import { Tooltip } from "StyledComponents";

Using the Tooltip Component

The Tooltip component can be used with various props to control its appearance. Here are some examples of how we can use it:

<Tooltip
content="Send To"
>

default tooltip


<Tooltip
className="tooltip tootlip-project px-3 py-2"
content="Add/Remove Team Members"
>

custom class


<Tooltip
placeBottom
className="tooltip tootlip-project px-3 py-2"
content="Add/Remove Team Members"
>

bottom tooltip


Tooltip Component Props

NameDescriptionDefault Value
contentThe content to be rendered inside the popup. string-
placeBottomTo specify the position of the Tooltip. by default it is placed on top of children component. boolfalse
showTo specify whether to show Tooltip or not. booltrue
delayTo display the Tooltip after n-milliseconds. number400
classNameSpecify the extra style classes needed for content of Tooltip string-
wrapperClassNameSpecify the extra style classes needed for Tooltip component string-
childrenTooltip popup will be shown when mouse is hovered over this component. node-