Skip to content
v0.2.10

Tooltip

Brief text help on hover or focus, with collision-aware placement.

Preview

Use Tooltip

Tooltip is a named export of @flood-md/react. Connect the package once, then import what you use.

First time here? Connect Flood
Example import style
tooltip.tsxTSX
"use client";

import { FloodRoot, Tooltip, Button } from "@flood-md/react";
import "@flood-md/react/styles.css";

export function Example() {
  return (
    <FloodRoot>
      <Tooltip content="Additional context" trigger={trigger => <Button {...trigger}>Hover or focus</Button>} />
    </FloodRoot>
  );
}

Design notes

  • Requires native Popover API.
  • Forward trigger props and ref to one actual button. Tooltip is text-only; interactive content belongs in Popover.
  • Escape dismisses. Hover can move onto the tooltip; focus stays on the trigger. Do not use it as the only accessible name or essential instruction.

API reference

PropValuesDefault
contentstringRequired
trigger(props: OverlayTriggerProps) => ReactNodeRequired
side"top" | "bottom" | "left" | "right""top"
align"start" | "center" | "end""center"
delaynumber300
disabledbooleanfalse
Native HTML propsOmit<HTMLAttributes<HTMLDivElement>, "children" | "content" | "title" | "role">Forwarded
View TypeScript source