Skip to content
Drivn logoDrivn

Tooltip

Pure CSS tooltip with 4 position options. Zero JavaScript.

Preview

TopTop tooltipBottomBottom tooltipLeftLeft tooltipRightRight tooltip

Installation

npx drivn add tooltip

Usage

1import { Tooltip } from "@/components/ui/tooltip"
2
3export default function Page() {
4 return (
5 <Tooltip content="This is a tooltip">
6 <span>Hover me</span>
7 </Tooltip>
8 )
9}

API Reference

PropTypeDefaultDescription
contentstringThe text displayed inside the tooltip
position"top" | "bottom" | "left" | "right""top"Where the tooltip appears relative to the trigger element
classNamestringAdditional CSS classes to apply to the tooltip container
childrenReactNodeThe trigger element that shows the tooltip on hover