Xzero UI
Pro library

Tooltip

Short supporting text for unfamiliar controls.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui/tooltip
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui/tooltip

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { Tooltip } from "@/components/xzero/tooltip/tooltip";

export function ArchiveButton() {
  return (
    <Tooltip content="Archive">
      <button type="button" aria-label="Archive">
        <ArchiveIcon />
      </button>
    </Tooltip>
  );
}

API reference

Tooltip

A short label on hover or focus that opens without delay when moving between tooltips.

PropTypeDefaultDescription
content (required)ReactNode–Tooltip content. Strings and numbers crossfade and resize when they change while open.
children (required)ReactElement–The trigger. Rendered with asChild, so it must accept a ref and be focusable.
side"top" | "bottom""top"Preferred side of the trigger.

Keyboard interactions

KeysAction
TabFocusing the trigger opens the tooltip.
EscapeCloses the tooltip.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in overlays

Guidance for AI tools

Tooltip: Short supporting text for unfamiliar controls. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components