Tooltip
Tooltip is used to describe or add additional information to the user.
#
Importimport { Tooltip } from '@volue/wave-react';
#
Examples#
BasicIf the Tooltip
is wrapping a functional component, ensure that the functional component accepts a ref
using forwardRef
.
#
Formatted contentTooltip accepts any valid React node as content.
#
PlacementTooltip uses Positioner under the hood, so you can control its placement
:
#
SizesTooltip
component comes in two sizes: medium
and small
. By default, it uses medium
size.
#
Controlled tooltipYou can make the dialog controlled, by passing your own state to isOpen
prop.
#
Disabled tooltipYou can disable showing the tooltip with isDisabled
prop. Also, if there is no content provided, tooltip will skip rendering.
#
Close on click#
Delayed close#
API ReferenceProp | Type | Default |
---|---|---|
children * | React.ReactNode | No default value |
content | React.ReactNode | No default value |
isOpen | boolean | false |
placement | enum | "bottom" |
size | enum | "medium" |
anchorOffset | number | 8 |
closeDelay | number | 100 |
isDisabled | boolean | false |
shouldCloseOnClick | boolean | true |
onClose | function | No default value |
onOpen | function | No default value |
addAriaDescription | boolean | true |