Tooltip

Names an icon-only button and its shortcut. bg/inverse, radius 8, Label/XS. 450ms before the first one, instant for its neighbours.

Delay and neighbours

Wrap the app in TooltipProvider once. The first tooltip waits 450ms and grows from its button (125ms, scale 0.97 and opacity). While one is open, moving to the next button opens its tooltip with no delay and no animation, so a toolbar feels fast after the first hover.

Usage

import { Tooltip, TooltipProvider } from "@kuori/ui/tooltip";
<Tooltip label="Archive" shortcut="E">  <button type="button">Archive</button></Tooltip>

Tooltip

PropTypeDescription
labelRequired
string
What the button does, in sentence case
shortcut
string
The keyboard shortcut, at 60%
side
'top''bottom''left''right'
Where it opens. The rail uses rightDefault: top
childrenRequired
ReactElement
The element it describes. It must take a ref and spread its props
className
string
Additional CSS classes

TooltipProvider

PropTypeDescription
childrenRequired
ReactNode
Everything whose tooltips share the delay