Tooltips
The Tooltip component is a styled container for content that should be displayed when triggered by an OverlayTrigger or TooltipTrigger. It does not exhibit any dynamic behavior on its own.
TooltipTriggers are simpler to use, and their associated Tooltips are shown and hidden using CSS visibility
rules.
In contrast to OverlayTriggers, the markup always exists in the DOM.
Props
Tooltip props
Property | Required | Type | Default | Description |
---|---|---|---|---|
isSticky | no | Boolean | false | Whether the tooltip hover is sticky or not |
size | no | oneOf(['auto', 'sm', 'md', 'lg']) | auto | Size of the tooltip |
visible | no | Boolean | true | Whether the tooltip contents are visible |
TooltipTrigger props
Property | Required | Type | Default | Description |
---|---|---|---|---|
clickHideDelay | no | Number | 1000 | How long (in milliseconds) to wait before hiding after click |
disabled | no | Boolean | false | Disables the tooltip trigger, causing the tooltip not to display regardless of other settings |
display | no | Boolean | false | if trigger is set to manual controls whether or not the tooltip is visible |
isSticky | no | Boolean | false | Whether the tooltip hover is sticky or not |
onEntered | no | Func | () => {} | Callback that is called after the tooltip is shown |
onExited | no | Func | () => {} | Callback that is called after the tooltip is hidden |
placement | no | oneOf(['left', 'right', 'bottom', 'top']) | top | Placement of tooltip in relation to target |
size | no | oneOf(['auto', 'sm', 'md', 'lg']) | auto | Size of the tooltip |
theme | no | oneOf(['light', 'dark']) | dark | Theme of tooltip background and text |
tooltip | yes | Node | Tooltip content - will be wrapped in a Tooltip component | |
trigger | no | oneOf(['hover', 'click', 'manual']) | hover | Action to trigger showing tooltip |
Imports
Import React components (including CSS):
import {Tooltip, TooltipTrigger} from 'pivotal-ui/react/tooltip';
Import CSS only:
import 'pivotal-ui/css/tooltips';