Components
Advanced tooltip for showing detailed content
Version: | 14.18.2 •View source•Changelog•Report issue | |
---|---|---|
Install: | yarn add @thumbtack/thumbprint-react | |
Import: | import { Popover, PopoverTitle, PopoverBody, PopoverPrimaryButton, PopoverSecondaryButton } from '@thumbtack/thumbprint-react'; |
children
Contents for the Popover. Usually a PopoverTitle
, PopoverBody
, and PopoverPrimaryButton
React.ReactNode
launcher
A function that renders JSX and receives an object with ref
.
All of these props must be added to the component within the render prop.
({ ref }: { ref: RefHandler }) => React.ReactNode
onCloseClick
Function called when the close button is clicked. You should cause this to set isOpen=false
in your parent component.
() => void
position
Position of popover relative to the launcher.
This prop can be one of the following 12 types:
'top-start'
'top'
'top-end'
'bottom-start'
'bottom'
'bottom-end'
'left-start'
'left'
'left-end'
'right-start'
'right'
'right-end'
'top'
isOpen
Whether or not the popover is visible.
boolean
false
container
By default popovers will render right before the </body>
tag.
Setting the container
to inline
causes the tooltip to remain where it was added to the
DOM.
This option is helpful to work around z-index and positioning issues.
This prop can be one of the following 2 types:
'inline'
'body'
'body'
accessibilityLabel
Accessibility title used to describe the content of the popover to screen readers.
string
'Popover'
children
The contents of the title.
React.ReactNode
children
The contents of the body.
React.ReactNode
children
The text of the button.
string
onClick
The function to call when the button is clicked.
() => void
children
The text of the button.
string
onClick
The function to call when the button is clicked.
() => void
to
Link to visit when the button is clicked. It will be opened in a new tab.
string