MDK Logo

SimpleTooltip

One-line convenience wrapper around the full `Tooltip` primitive set. Pass `content` (the hover text) and any single React element as `children` — `SimpleToo…

One-line convenience wrapper around the full <Tooltip> primitive set. Pass content (the hover text) and any single React element as children<SimpleTooltip> handles the provider, trigger, portal and content for you. Prefer this over composing <Tooltip> + <TooltipTrigger> + <TooltipContent> unless you need custom positioning or async content.

import { SimpleTooltip } from "@tetherto/mdk-react-devkit";
PropStatusTypeDefaultDescription
contentRequiredReact.ReactNodeTooltip content (string or JSX)
sideOptionalPosition | undefined"top"Position of the tooltip relative to trigger
sideOffsetOptionalnumber | undefined8Distance from the trigger in pixels
delayDurationOptionalnumber | undefined200Delay before showing tooltip (ms)
showArrowOptionalboolean | undefinedtrueWhether to show the arrow
classNameOptionalstring | undefinedAdditional class for content
childrenRequiredReact.ReactNodeElement that triggers the tooltip

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>  )}