Examples

Icon buttons

Once one tooltip is visible, neighbours appear without delay.

Preview
Example.tsx
import { HStack, IconButton, Tooltip } from '@reactloom/ui';
import { Copy, Download, Pencil, Trash2 } from 'lucide-react';

export default function Example() {
  return (
    <HStack gap="1">
      <Tooltip content="Edit"><IconButton icon={<Pencil />} label="Edit" /></Tooltip>
      <Tooltip content="Duplicate"><IconButton icon={<Copy />} label="Duplicate" /></Tooltip>
      <Tooltip content="Download PDF"><IconButton icon={<Download />} label="Download PDF" /></Tooltip>
      <Tooltip content="Delete"><IconButton icon={<Trash2 />} label="Delete" variant="destructive" /></Tooltip>
    </HStack>
  );
}

Placement

Preview
Example.tsx
import { Button, HStack, Tooltip } from '@reactloom/ui';

export default function Example() {
  return (
    <HStack gap="2" wrap>
      {(['top', 'right', 'bottom', 'left'] as const).map((placement) => (
        <Tooltip key={placement} content={`Placed ${placement}`} placement={placement}>
          <Button variant="secondary">{placement}</Button>
        </Tooltip>
      ))}
    </HStack>
  );
}

API reference

Tooltip props
PropTypeDefault
contentrequired
Short, non-interactive text.
ReactNode—
childrenrequired
One focusable element.
ReactElement—
placement
OverlayPlacement'top'
delay · closeDelay
ms
number600 · 0
open / defaultOpen · onOpenChange
Controlled visibility.
—
disabled
booleanfalse

Customization

Extracted from the component’s source on every build, so it matches the code. How the layers fit together is explained in Customization.

Theme tokens it reads

--pl-color-bg-inverse --pl-color-fg-inverse --pl-font-size-xs --pl-radius-sm

Accessibility

  • Shown on keyboard focus, not only hover; Escape hides it.
  • Linked with aria-describedby; IconButton keeps its own aria-label as the name.
  • Never put links or buttons inside a tooltip — use Popover.
Keyboard interactions
KeyAction
TabFocus the trigger: show
EscapeHide

Usage guidelines

Do

  • Keep tooltip text to a few words.

Don’t

  • Don’t hide essential information in tooltips.
  • Don’t add tooltips to disabled buttons (they cannot be focused).