Tooltip
Last updated: 2.0.0 (22/01/2024)
Usage
Uncontrolled Tooltips will not show on mobile breakpoints.
Controlled
The Tooltip be used in a controlled fashion using the useDisclosure
hook. The Tooltip will automatically hide when clicked away from (i.e. another element is focused), regardless of whether or not it is controlled.
Custom content
The Tooltip.Content
component accepts any valid JSX, or a raw string. This can be used to pass in icons or more complex content.
Props
TooltipProps
Extends TooltipOptions
.
children (required)
ReactNode
TooltipTriggerProps
children (required)
ReactElement<any>
TooltipContentProps
Extends StyledFlexProps
.
children (required)
string | ReactNode
withShadow
boolean
Whether to display a shadow underneath the tooltip.
zIndex
CSSProperties["zIndex"]
The z-index of the tooltip.
Changelog
2.2.0: Uncontrolled tooltips will no longer show on mobile breakpoints. Controlled tooltips (i.e. those that accept the
disclosure
prop) are unaffected.
Last updated
Was this helpful?