Tooltip

import {Tooltip} from "@qui/react-vscode"

Examples

Showcase

Dark Modern
import type {ReactElement} from "react"
import {
Button,
Tooltip,
TooltipContent,
TooltipTrigger,
} from "@qui/react-vscode"
export default function Showcase(): ReactElement {
return (
<Tooltip>
<TooltipTrigger>
<Button>Hover or Focus</Button>
</TooltipTrigger>
<TooltipContent>Tooltip Content</TooltipContent>
</Tooltip>
)
}

API

TooltipProps

Name & DescriptionOption(s)Default
React children prop.
ReactNode
The CSS transition-duration of the enter and exit animations. Supply as a number to configure both transitions at once, or supply an object to configure the enter and exit transitions independently.
| number
| {
enter: number
exit: number
}
80
Ensure that the component remains anchored to its reference element following screen resizes or position changes.
boolean
The default value when uncontrolled.
boolean
Whether to flip the component's placement to keep it in view.
boolean
true
id attribute. If omitted, a unique identifier will be automatically generated for accessibility.
string
The distance between the tooltip and its anchor element.
| number
| {
alignmentAxis?: number
crossAxis?: number
mainAxis?: number
}
5
The controlled state for the tooltip. Supplying this value will override hover and focus events.
boolean
If true, the component will show when the anchor element is focused. This property is ignored if open is supplied.
boolean
false
If true, the component will show when the anchor element is hovered. This property is ignored if open is supplied.
boolean
false
Describes the placement of the component before FloatingUI has applied all the modifiers that may have flipped or altered the component. The final placement may differ from this input property.
| 'top-start'
| 'top'
| 'top-end'
| 'bottom-start'
| 'bottom'
| 'bottom-end'
| 'left-start'
| 'left'
| 'left-end'
| 'right-start'
| 'right'
| 'right-end'
'top'
CSS position attribute of the component. Can be "absolute" or "fixed".
| 'absolute'
| 'fixed'
'absolute'
The z-index CSS property sets the z-order of a positioned element and its descendants or flex items. Overlapping elements with a larger z-index cover those with a smaller one.
| string
| number
1080
Description
React children prop.
Type
| number
| {
enter: number
exit: number
}
Default
80
Description
The CSS transition-duration of the enter and exit animations. Supply as a number to configure both transitions at once, or supply an object to configure the enter and exit transitions independently.
Type
boolean
Description
Ensure that the component remains anchored to its reference element following screen resizes or position changes.
Type
boolean
Description
The default value when uncontrolled.
Type
boolean
Default
true
Description
Whether to flip the component's placement to keep it in view.
Type
string
Description
id attribute. If omitted, a unique identifier will be automatically generated for accessibility.
Type
| number
| {
alignmentAxis?: number
crossAxis?: number
mainAxis?: number
}
Default
5
Description
The distance between the tooltip and its anchor element.
Type
boolean
Description
The controlled state for the tooltip. Supplying this value will override hover and focus events.
Type
boolean
Default
false
Description
If true, the component will show when the anchor element is focused. This property is ignored if open is supplied.
Type
boolean
Default
false
Description
If true, the component will show when the anchor element is hovered. This property is ignored if open is supplied.
Type
| 'top-start'
| 'top'
| 'top-end'
| 'bottom-start'
| 'bottom'
| 'bottom-end'
| 'left-start'
| 'left'
| 'left-end'
| 'right-start'
| 'right'
| 'right-end'
Default
'top'
Description
Describes the placement of the component before FloatingUI has applied all the modifiers that may have flipped or altered the component. The final placement may differ from this input property.
Type
| 'absolute'
| 'fixed'
Default
'absolute'
Description
CSS position attribute of the component. Can be "absolute" or "fixed".
Type
| string
| number
Default
1080
Description
The z-index CSS property sets the z-order of a positioned element and its descendants or flex items. Overlapping elements with a larger z-index cover those with a smaller one.