Skip to content
Feedback

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

PropTypeDefault
content required
string—
placement
Placement'top'
delay

Milliseconds to wait before showing.

number120
class
string—

Snippets of Tooltip

SnippetTypeDefault
children
Snippet—

See also

cock. Yes, it stands for core component kit. We checked twice.