UI: Tooltip
A short text next to its trigger, with TooltipTrigger. Import the token file once (@pithyx/ui/tokens.css) and wrap the app in UiProvider; see @pithyx/ui.
Generated from the TSDoc comments of @pithyx/ui 1.0.0-rc.9 at build time; the text below the headings is the comment in the source.
Interfaces
Section titled “Interfaces”TooltipProps
Section titled “TooltipProps”The props of Tooltip.
Extends
Section titled “Extends”Omit<AriaTooltipProps,"className">
Properties
Section titled “Properties”className?
Section titled “className?”optional className?: string;Extra class names, added after the tooltip’s own.
Variables
Section titled “Variables”TooltipTrigger
Section titled “TooltipTrigger”const TooltipTrigger: (props) => Element = AriaTooltipTrigger;Shows a Tooltip for its first child on hover and keyboard focus. It is React Aria’s TooltipTrigger; its
props (delay, closeDelay, isDisabled) are documented there.
TooltipTrigger wraps around a trigger element and a Tooltip. It handles opening and closing the Tooltip when the user hovers over or focuses the trigger, and positioning the Tooltip relative to the trigger.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
props |
TooltipTriggerComponentProps |
Returns
Section titled “Returns”Element
props
React Aria’s tooltip trigger props, the trigger and the tooltip.
Returns
Section titled “Returns”The trigger with its tooltip.
Functions
Section titled “Functions”Tooltip()
Section titled “Tooltip()”function Tooltip(props): Element;A short text next to its trigger; wrap both in a TooltipTrigger. A tooltip shows on hover and keyboard focus,
never on touch, so it must not carry anything the user needs.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
props |
TooltipProps |
React Aria’s tooltip props (placement, offset) and the text. |
Returns
Section titled “Returns”Element
The tooltip.
Example
Section titled “Example”<TooltipTrigger> <Button>Sync</Button> <Tooltip>Last synced 5 minutes ago</Tooltip></TooltipTrigger>