MDK Logo

Tooltip

Tooltip Root - Container for a single tooltip

Tooltip Root - Container for a single tooltip

import { Tooltip } from "@tetherto/mdk-react-devkit";

Tooltip exposes no documented props.

Usage

Hover-triggered floating label built on Radix UI. Two ways to use it:

  • SimpleTooltip — one-prop wrapper, recommended for most cases.
  • Tooltip + sub-parts — full composition for advanced control.

SimpleTooltip props

PropTypeRequiredDefaultDescription
contentReactNodeyesTooltip body (string or JSX).
childrenReactNodeyesTrigger element (any focusable node).
side"top" | "right" | "bottom" | "left"no"top"Side relative to trigger.
sideOffsetnumberno8Distance from the trigger (px).
delayDurationnumberno200Hover delay before showing (ms).
showArrowbooleannotrueRender a directional arrow.
classNamestringnoContent class names.

Composable parts

<TooltipProvider delayDuration={200}>
  <Tooltip>
    <TooltipTrigger asChild><InfoIcon /></TooltipTrigger>
    <TooltipContent side="right">Helpful explanation</TooltipContent>
  </Tooltip>
</TooltipProvider>

Notes

  • For click-triggered panels, use Popover instead.
  • If content is empty/null, SimpleTooltip renders the trigger unwrapped.
  • Wrap your app in a single <TooltipProvider> when you have many tooltips to share the open/close timing logic.

Example

/** * Runnable example for Tooltip / SimpleTooltip. */import { Button, SimpleTooltip } from '@tetherto/mdk-react-devkit'export const TooltipExample = () => {  return (    <div style={{ display: 'flex', gap: 16 }}>      <SimpleTooltip content="Refresh data" side="bottom">        <Button>Refresh</Button>      </SimpleTooltip>      <SimpleTooltip content="Saves to the current workspace" side="right">        <Button variant="primary">Save</Button>      </SimpleTooltip>    </div>  )}