Skip to main content
Mantı UI logoMantı UIv0.12.1
Studio

Tooltip

Wrap a focusable trigger and pass content. The machine manages placement, delays, focus, hover, and dismissal.

Set interactive only when the pointer must enter the tooltip content. Use placement, controlled open state, and portalled when the trigger lives inside overflow or stacking contexts. portalContainer targets a specific portal host.

import { Button, Tooltip } from '@manti-ui/react';

export default function TooltipBasic() {
  return (
    <>
      <Tooltip content="Backed by a Zag.js machine">
        <Button variant="secondary">Hover or focus me</Button>
      </Tooltip>
      <Tooltip content="Stays open while you hover the label" interactive>
        <Button variant="tertiary">Interactive</Button>
      </Tooltip>
    </>
  );
}

API

PropTypeDefaultDescription
contentReactNodeThe tooltip content.
childrenReactNodeThe trigger (wrapped in an inline trigger).
openDelaynumberDelay before opening, in ms.
closeDelaynumberDelay before closing, in ms.
interactivebooleanKeep open while hovering the content.
placementPlacementPlacement relative to the trigger.
showArrowbooleantrueRender the arrow pointing at the trigger.
open / defaultOpen / onOpenChangecontrolled stateControlled or uncontrolled open state.
portalled / portalContainerboolean / RefObject<HTMLElement>Portal the content, optionally into a custom host.

Styling

Anatomy

PartSelectorDescription
trigger[data-scope="tooltip"][data-part="trigger"]Inline wrapper around the child.
positioner[data-scope="tooltip"][data-part="positioner"]Positions the floating content.
content[data-scope="tooltip"][data-part="content"]The floating label.
arrow[data-scope="tooltip"][data-part="arrow"]The arrow pointing at the trigger.

Tokens

TokenControls
--manti-tooltip-max-widthmax width
--manti-tooltip-z-indexz index

Last updated

Built end-to-end with Manti UI components and design tokens. Manti UI is a framework-agnostic design system on Zag.js.

GitHub