components/Tooltip
import { … } from 'zidane-ui'ui/src/components/Tooltip.tsx
Components#
TooltipComponent#
Renders a small label that fades in under or above its trigger on hover or keyboard focus.
The first one waits about 400 ms so a passing cursor never flashes it, a following one
within 600 ms opens at once, and focus opens it immediately. Pressing the trigger or Esc
hides it until the pointer and focus leave. The bubble describes the trigger through
aria-describedby and is not interactive.
function Tooltip(props: TooltipProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | TooltipProps | Component props. |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| align? | 'end' | 'center' | Horizontal anchor. |
| children | ReactNode | The trigger. Hovering it, or keyboard focus on it, shows the tooltip. |
| className? | string | Extra classes on the wrapping element. |
| disabled? | boolean | Never opens, while the trigger's own surface is open (a popover over the same spot). |
| label | ReactNode | The tooltip content. Keep it short. |
| maxWidth? | number | Wrap long labels at this width (px) instead of one line. |
| portal? | boolean | Render the bubble into |
| side? | 'bottom' | 'top' | Where the bubble sits relative to the trigger. |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |
Interfaces#
TooltipPropsInterface#
Props for Tooltip.
interface TooltipPropsProperties
| Name | Type | Description |
|---|---|---|
| align? | 'end' | 'center' | Horizontal anchor. |
| children | ReactNode | The trigger. Hovering it, or keyboard focus on it, shows the tooltip. |
| className? | string | Extra classes on the wrapping element. |
| disabled? | boolean | Never opens, while the trigger's own surface is open (a popover over the same spot). |
| label | ReactNode | The tooltip content. Keep it short. |
| maxWidth? | number | Wrap long labels at this width (px) instead of one line. |
| portal? | boolean | Render the bubble into |
| side? | 'bottom' | 'top' | Where the bubble sits relative to the trigger. |
| style? | CSSProperties | Inline styles on the root element, merged after the component's own. |