Tooltip
A popup that displays information related to an element when the element receives keyboard focus or the mouse hovers over it.
Examples
Basic
Prop | Default | Type | Description |
---|---|---|---|
content | - | string | Set the tooltip content. |
defaultOpen | false | boolean | The open state of the tooltip when it is initially rendered. Use when you do not need to control its open state. |
delayDuration | - | number | Override the duration given to the Provider to customize the open delay for a specific tooltip. |
disableClosingTrigger | - | boolean | When true, clicking on trigger will not close the content. |
disabled | - | boolean | When true, disable tooltip a |
disableHoverableContent | - | boolean | Prevents Tooltip.Content from remaining open when hovering. Disabling this has accessibility consequences. Inherits from Tooltip.Provider. |
ignoreNonKeyboardFocus | - | boolean | Prevent the tooltip from opening if the focus did not come from the keyboard by matching against the |
open | false | boolean | The controlled open state of the tooltip. |
Read more in Radix Tooltip Root API.
Color
Prop | Default | Type | Description |
---|---|---|---|
tooltip | black | string | Set the tooltip color. |
Size
Prop | Default | Type | Description |
---|---|---|---|
size | xs | string | Set the tooltip general size. |
Provider
Configure the tooltip provider by using the _tooltipProvider
prop.
Prop | Default | Type | Description |
---|---|---|---|
delayDuration | 700 | number | The duration from when the pointer enters the trigger until the tooltip gets opened. |
disableClosingTrigger | - | boolean | When true , clicking on trigger will not close the content. |
disabled | - | boolean | When true , disable tooltip. |
disableHoverableContent | false | boolean | When true , trying to hover the content will result in the tooltip closing as the pointer leaves the trigger. |
ignoreNonKeyboardFocus | false | boolean | Prevent the tooltip from opening if the focus did not come from the keyboard by matching against the |
skipDelayDuration | 300 | number | How much time a user has to enter another trigger without incurring a delay again. |
Read more in Radix Tooltip Provider API
Content
Configure the tooltip content using the _tooltipContent
prop.
Prop | Default | Type | Description |
---|---|---|---|
align | center | start end center | The preferred alignment against the trigger. May change when collisions occur. |
alignOffset | - | number | An offset in pixels from the start or end alignment options. |
side | top | top right bottom left | The preferred side of the trigger to render against when open. Will be reversed when collisions occur and avoidCollisions is enabled. |
sideOffset | - | number | The distance in pixels from the trigger. |
Read more in Radix Tooltip Content API
Slots
Name | Props | Description |
---|---|---|
default | - | The trigger slot. |
content | - | The content slot. |
Presets
shortcuts/tooltip.ts
Props
types/tooltip.ts