Tooltip
A short hint on hover and on keyboard focus.
import
import { Tooltip } from '@joshicodes/cock';Placements
Behaviour
- Renders into `<body>` and positions itself against its trigger, so an `overflow: hidden` ancestor or a scrolling table cannot clip it.
- Opens on focus as well as hover, so it is reachable without a mouse. Never put anything in it that is only available there.
API
Read out of the component sources at build time, so it matches the version you installed.
Every component also takes class, merged
through tailwind-merge so your utility wins.
Props of Tooltip
| Prop | Type | Default |
|---|---|---|
content required | string | — |
placement | Placement | 'top' |
delay Milliseconds to wait before showing. | number | 120 |
class | string | — |
Snippets of Tooltip
| Snippet | Type | Default |
|---|---|---|
children | Snippet | — |