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'; | |
childrenContents for the Popover. Usually a PopoverTitle, PopoverBody, and PopoverPrimaryButton
React.ReactNodelauncherA 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.ReactNodeonCloseClickFunction called when the close button is clicked. You should cause this to set isOpen=false
in your parent component.
() => voidpositionPosition 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'isOpenWhether or not the popover is visible.
booleanfalsecontainerBy 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'accessibilityLabelAccessibility title used to describe the content of the popover to screen readers.
string'Popover'childrenThe contents of the title.
React.ReactNodechildrenThe contents of the body.
React.ReactNodechildrenThe text of the button.
stringonClickThe function to call when the button is clicked.
() => voidchildrenThe text of the button.
stringonClickThe function to call when the button is clicked.
() => voidtoLink to visit when the button is clicked. It will be opened in a new tab.
string