Skip to the page
Supply UI

Tooltip

A short hint for an icon button. Never put information only in a tooltip: phones have no hover.

Preview

Use

The code of the preview above
import { Button, Row, Tooltip } from '@/components/ui';
import { Copy, Pencil, Share2, Trash2 } from 'lucide-react';

<Row gap={1}>
  <Tooltip content="Edit">
    <Button icon variant="ghost" aria-label="Edit"><Pencil /></Button>
  </Tooltip>
  <Tooltip content="Duplicate">
    <Button icon variant="ghost" aria-label="Duplicate"><Copy /></Button>
  </Tooltip>
  <Tooltip content="Share">
    <Button icon variant="ghost" aria-label="Share"><Share2 /></Button>
  </Tooltip>
  <Tooltip content="Delete">
    <Button icon variant="ghost" aria-label="Delete"><Trash2 /></Button>
  </Tooltip>
</Row>

This page as text, for an AI

Options

OptionTypeWhat it does
children NeededReactElement<Record<string, unknown>, string | JSXElementConstructor<any>>The element the tooltip describes: one button or link.
content NeededReactNodeThe short text shown on hover and focus.
delay numberHow long, in ms, the pointer rests before the first tooltip opens (the next ones open at once). 600 by default; a short one (about 150) where people sweep across many things to read their names, like a grid of icons.
side "top" | "bottom" | "left" | "right" · default 'top'Which side of the element it shows on: top (default), bottom, left or right.

Parts

What goes inside one.

Without React

With the CSS in parts (/ui/css/), it needs these, besides the ones every page loads:

components/card.csscomponents/popups.csscomponents/tooltip.csscomponents/prose.cssparts/board.css

In the examples

Small screens made with it and the rest of the kit. They work: click, type and choose in them.

Ask Otis to bring the spare key on Friday. The plumber comes at nine.

Write it down Styles from the toolbar, a tip on every button

Orders

  • #1187 · Noor Haddad
  • #1188 · Otis Brandt
  • #1189 · Yuki Tanabe
Icons in a rail A narrow column, a name on hover, ink for where you are

On top of the page: states, do and don’t

The name of an icon button. Never the only place for information: phones have no hover. It opens after the pointer rests 600ms; delay={150} where people sweep across many things to read their names, like a grid of icons.

States. Closed, opening (fades and rises), open, closing (fades before what it changed appears: afterClose). While open, focus is inside and Escape closes it; when it closes, focus goes back to what opened it.

Do

  • Name every dialog, drawer and popover (DialogTitle, DrawerTitle, or aria-label).
  • Use AlertDialog for anything that cannot be undone, with the action named on its button ("Delete 3 files").
  • Use a Drawer on a phone for what a Popover does on a computer.

Don't

  • Don't open a dialog from a dialog; change what the open one shows instead.
  • Don't put the only way to do something in a right-click menu or a tooltip.
  • Don't use a toast for something the person must not miss: that is an Alert on the page.