Render the control through render on TooltipTrigger. Touch screens do not show the tooltip, so an icon button keeps its own aria-label.
The sample also uses Button. One command adds them with this item:
copy-link-button.tsx
Tooltip
| Prop | Type | Default | Description | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
From Base UITooltip.RootBase UI docs | |||||||||||||||||||||||||||||||||||||||||||||
| default | boolean | false | Whether the tooltip is initially open. To render a controlled tooltip, use the open prop instead. | ||||||||||||||||||||||||||||||||||||||||||
| open | boolean | — | Whether the tooltip is currently open. | ||||||||||||||||||||||||||||||||||||||||||
| on | — | Event handler called when the tooltip is opened or closed. | |||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||
TooltipTrigger
<button>| Prop | Type | Default | Description | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | |||||||||||||||||||||||||||
| wrap | boolean | false | Render the trigger as an inline-flex span around its children, in place of render: for a disabled Button that shows why it is off. See the JSDoc of TooltipTrigger. Default false. | ||||||||||||||||||||||||||
From Base UITooltip.TriggerBase UI docs | |||||||||||||||||||||||||||||
| handle | TooltipHandle<unknown> | — | A handle to associate the trigger with a tooltip. | ||||||||||||||||||||||||||
| payload | unknown | — | A payload to pass to the tooltip when it is opened. | ||||||||||||||||||||||||||
| delay | number | 600 | How long to wait before opening the tooltip on hover. Specified in milliseconds. | ||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
| ...props | <button> attributes | — | Every other attribute goes to the <button>, with a ref. | ||||||||||||||||||||||||||
TooltipContent
<div>| Prop | Type | Default | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| class | string | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| arrow | boolean | false | Show an arrow that points at the trigger. The gap grows from 6px to 10px. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| portal | — | Other Base UI props of the inner parts. A className here adds to the component classes. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| positioner | — | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| arrow | PopupPartProps<TooltipArrowProps> | — | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
From Base UITooltip.PositionerBase UI docs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| anchor | — | An element to position the popup against. By default, the popup will be positioned against the trigger. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| position | "absolute""fixed" | 'absolute' | Determines which CSS position property to use. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| side | number | OffsetFunction | 0 | Distance between the anchor and the popup in pixels. Also accepts a function that returns the distance to read the dimensions of the anchor and positioner elements, along with its side and alignment. The function takes a data object parameter with the following properties: - data.anchor: the dimensions of the anchor element with properties width and height. - data.positioner: the dimensions of the positioner element with properties width and height. - data.side: which side of the anchor element the positioner is aligned against. - data.align: how the positioner is aligned relative to the specified side. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
TooltipViewport
<div>| Prop | Type | Default | Description |
|---|---|---|---|
| class | string | — | |
From Base UITooltip.ViewportBase UI docs | |||
| children | ReactNode | — | The content to render inside the transition container. |
| render | — | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. | |
| style | — | Style applied to the element, or a function that returns a style object based on the component's state. | |
| ...props | <div> attributes | — | Every other attribute goes to the <div>, with a ref. |
| Tab | Opens the tooltip when the trigger gets focus. |
|---|---|
| Esc | Closes the tooltip. |
- ButtonA button for an action on the page, such as Save or Delete. It has 9 looks and 5 sizes, and a spinner that keeps its width while the action runs.
- KbdShows a key or a shortcut in text, such as a search hint, a shortcut in a menu, or a key in help text.
- PopoverPick Popover for more text, a link, or a control: it opens on a click and holds interactive content.
- Hover CardPick Hover Card for a rich preview of a link, such as a person or a page, with more than a short label.







