Tooltip
Base UIA short ink label on hover or focus.
Install
$ npx shadcn@latest add https://spotcheckui.com/r/tooltip.jsonAlso installs @base-ui/react.
Usage
import { Tooltip } from "@/components/spotcheck/tooltip"
import { Button } from "@/components/spotcheck/button"
<Tooltip content="Runs in the background">
<Button>Queue run</Button>
</Tooltip>Tooltips are for sighted pointer and keyboard users. They never appear on touch, and screen readers don't get the text, so give the control its own label and keep essential information out.
Props
- content * Required
ReactNodeDefault —The tooltip text. - children * Required
ReactElement<Record<string, unknown>, string | JSXElementConstructor<any>>Default —One focusable element, such as a button. - side
"top" | "right" | "bottom" | "left"Default top - className
stringDefault —
Keyboard
| Tab | Focus the control to show the tooltip |
|---|---|
| Esc | Hide the tooltip |
Reduced motion
The label appears without animation.