Tooltip
Usage
موست رو بیار روی من
import Tooltip from "@repo/ui/Tooltip";
<Tooltip id="tooltip" content="این یک راهنما است.">
موست رو بیار روی من
</Tooltip>;
Installation
npx the-dig@latest add Tooltip
Props
id, content, and a single ReactElement child are required. Placement defaults to top and positionStrategy to fixed; the id must be unique. Ensure the child forwards refs and trigger props so keyboard focus can display the tooltip.
| Prop | Type | Default |
|---|---|---|
id * | string | - |
content * | string | - |
className | string | - |
positionStrategy | "fixed" | "absolute" | fixed |
place * | "top" | "bottom" | "left" | "right" | "left-start" | "left-end" | "right-start" | "right-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "top" |
children | ReactNode | - |
Placements
top
top-start
top-end
bottom
bottom-start
bottom-end
left
left-start
left-end
right
right-start
right-end