Tooltip

A tooltip is a brief, informative message that appears when a user interacts with an element.

    SourceTheme source@chakra-ui/tooltip

Props#

childrenrequired

Description

The React component to use as the trigger for the tooltip

Type
ReactNode

aria-label

Description

The accessible, human friendly label to use for screen readers. If passed, tooltip will show the content label but expose only `aria-label` to assistive technologies

Type
string

arrowPadding

Description

The padding required to prevent the arrow from reaching the very edge of the popper.

Type
number
Default
8

arrowShadowColor

Type
string

arrowSize

Type
number
Default
10

closeDelay

Description

Delay (in ms) before hiding the tooltip

Type
number
Default
0ms

closeOnClick

Description

If true, the tooltip will hide on click

Type
boolean
Default
true

closeOnEsc

Description

If true, the tooltip will hide on pressing Esc key

Type
boolean
Default
true

closeOnMouseDown

Description

If true, the tooltip will hide while the mouse is down

Type
boolean

colorScheme

Description

Color Schemes for Tooltip are not implemented in the default theme. You can extend the theme to implement them.

Type
(string & {})

defaultIsOpen

Description

If true, the tooltip will be initially shown

Type
boolean

direction

Description

Theme direction ltr or rtl. Popper's placement will be set accordingly

Type
"ltr" | "rtl"
Default
"ltr"

gutter

Description

The distance or margin between the reference and popper. It is used internally to create an offset modifier. NB: If you define offset prop, it'll override the gutter.

Type
number
Default
8

hasArrow

Description

If true, the tooltip will show an arrow tip

Type
boolean

isDisabled

Type
boolean

isOpen

Description

If true, the tooltip will be shown (in controlled mode)

Type
boolean

label

Description

The label of the tooltip

Type
ReactNode

modifiers

Description

Array of popper.js modifiers. Check the docs to see the list of possible modifiers you can pass. @see Docs https://popper.js.org/docs/v2/modifiers/

Type
Partial<Modifier<string, any>>[]

offset

Description

The main and cross-axis offset to displace popper element from its reference element.

Type
[number, number]

onClose

Description

Callback to run when the tooltip hides

Type
(() => void)

onOpen

Description

Callback to run when the tooltip shows

Type
(() => void)

openDelay

Description

Delay (in ms) before showing the tooltip

Type
number
Default
0ms

placement

Description

The placement of the popper relative to its reference.

Type
PlacementWithLogical
Default
"bottom"

portalProps

Description

Props to be forwarded to the portal component

Type
Pick<PortalProps, "appendToParentPortal" | "containerRef">

shouldWrapChildren

Description

If true, the tooltip will wrap its children in a `<span/>` with `tabIndex=0`

Type
boolean

size

Description

Sizes for Tooltip are not implemented in the default theme. You can extend the theme to implement them.

Type
string

variant

Description

Variants for Tooltip are not implemented in the default theme. You can extend the theme to implement them.

Type
string
Edit this page on GitHub

Proudly made inNigeria by Segun Adebayo

Deployed by Vercel