npx shadcn@latest add https://components.bksh.site/r/icon-tooltip.json

Mouse

Icon Tooltip

An icon button that reveals a tooltip — choose the side and delay.

Example.tsx
import { IconTooltip } from "@/components/better/icon-tooltip"
import { GearIcon } from "@phosphor-icons/react"
export function Example() {
return (
<IconTooltip
icon={<GearIcon className="size-5" />}
label="Settings"
side="top"
delay={0}
duration={0}
/>
)
}

Dependencies

Props

PropTypeDefaultDescription
icon*ReactNode
label*string
classNamestring
sideSide"top"Which side the tooltip appears on.
delaynumber0Delay before it appears, in ms.
durationnumber0Auto-hide after this many ms once shown (0 = stay until mouse leaves).