Skip to main content

Tooltip

import { Tooltip } from "@study/ui"

Result
Loading...
Live Editor
<div style={{ paddingTop: 48, display: "flex", gap: 16 }}>
  <Tooltip content="Shares the invitation link">
    <Button icon="link">Invite</Button>
  </Tooltip>
  <Tooltip content="Below instead of above" side="bottom">
    <Button>Below</Button>
  </Tooltip>
</div>

When to use​

  • For extras that people do not need to use the app.
  • IconButton already shows its name itself – no tooltip there.
  • Do not rely on it on phones: there is no hover there.

Props​

PropTypeDefaultMeaning
children *ReactElement<{ "aria-describedby"?: string | undefined; }, string | JSXElementConstructor<any>>–One element that can take focus, e.g. a button.
content *string–A few words; never anything one needs to read to use the app.
side"top" | "bottom"top

Accessibility​

  • Also appears on keyboard focus; connected through aria-describedby.
  • Only after 300 ms, so that it does not flicker when the pointer passes over.