1Sponsor

Tooltip

Contextual tooltip on focus or hover

Terminal

Installation

pnpm dlx shadcn@latest add https://termcn.dev/r/tooltip.json

Usage

import { Tooltip } from "@/components/ui/tooltip";
<Tooltip content="Save your current progress" position="top" isVisible={true}>
  <Text bold>[S] Save</Text>
</Tooltip>

API Reference

Tooltip

PropTypeDefault
childrenReactNoderequired
contentstringrequired
position"top" | "bottom" | "left" | "right""top"
isVisiblebooleanfalse
borderStyle"single" | "double" | "round" | "bold" | "singleDouble" | "doubleSingle" | "classic""single"
borderColorstringundefined
paddingXnumber1
paddingYnumber0
gapnumber1
arrowDownstring"↓"
arrowUpstring"↑"