Tooltip

A short label shown on hover or keyboard focus.

import { Button, Tooltip } from '@brand-studio/ui';

export default function TooltipDemo() {
  return (
    <div style={{ display: 'flex', flexWrap: 'wrap', gap: 12 }}>
      <Tooltip content="Saved to your library">
        <Button tone="secondary">Hover or focus me</Button>
      </Tooltip>
      <Tooltip content="Opens in a new tab" side="bottom">
        <Button tone="secondary">Below</Button>
      </Tooltip>
    </div>
  );
}

Installation

pnpm add @brand-studio/ui

Usage

import { Tooltip } from '@brand-studio/ui';
<Tooltip content="Saved to your library">
  <Button tone="secondary">Save</Button>
</Tooltip>

Accessibility

  • Opens on hover after a short delay and on keyboard focus. Escape closes it.
  • The child must be focusable, such as a button. Do not put information only in a tooltip; touch screens cannot hover.

API Reference

PropTypeDefault
contentReact.ReactNode
childrenReact.ReactElement<unknown, string | React.JSXElementConstructor<any>>
side?"bottom" | "left" | "right" | "top"'top'
delay?number300

Still, Deskhand and Hollis are fictional brands. The coffee photographs are original generated artwork. @brand-studio/ui is MIT licensed.