A lightweight, customizable React tooltip component with multiple positioning options and themes.
- 🎨 8 Different positioning options
- 🌈 Dark/Light theme support
- 📦 Lightweight package size
- 🔧 Easy customization
- 💨 Tailwind CSS support
- 🎯 TypeScript support
- ⚡️ Zero dependencies (except React)
npm install tail-tooltip-react
# or
yarn add tail-tooltip-react
import Tooltip from "tail-tooltip-react";
function App() {
return (
<Tooltip content="Hello World!" position="top-center">
<button>Hover me!</button>
</Tooltip>
);
}
Prop | Type | Default | Description |
---|---|---|---|
content | ReactNode | - | Tooltip content |
position | TooltipPosition | 'top-center' | Tooltip position |
color | 'dark' | 'white' | 'dark' | Tooltip theme |
width | number | string | - | Custom width |
className | string | - | Additional classes |
top-left
top-center
top-right
right
bottom-right
bottom-center
bottom-left
left
<Tooltip position="top-left" content="Top Left">
<button>Hover me</button>
</Tooltip>
<Tooltip content="Custom width tooltip" width={200}>
<button>Wide tooltip</button>
</Tooltip>
<Tooltip content="Light theme" color="white">
<button>Light</button>
</Tooltip>
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
MIT