Tooltip

Radix Tooltip with a small sketch bubble. Wrap the app in TooltipProvider once (the docs site already does). The bubble draws in quickly when it shows.

<Tooltip content="A small sketch bubble" roughness={1.5}>
  <Button variant="outline">Hover me</Button>
</Tooltip>

CLI install

npx doodleui-react add tooltip

Usage

import { Tooltip, TooltipProvider, Button } from "doodleui-react";

<TooltipProvider>
  <Tooltip content="A small sketch bubble">
    <Button variant="outline">Hover me</Button>
  </Tooltip>
</TooltipProvider>

The trigger must accept a ref. Native elements and doodle-ui buttons both work. If you pass a custom component, wrap it with forwardRef.

Props

PropTypeDefaultNotes
contentReactNoderequiredBubble body.
side"top" | "right" | "bottom" | "left""top"Radix placement.
delayDurationnumber200Hover delay in milliseconds.
animatebooleantrueQuick draw-in when the bubble shows (~180ms). Overrides DoodleUIProvider. Reduced motion disables this unless the provider set forceAnimate.
roughnessnumber1.5How wobbly the stroke is. 0 is almost geometric. 3+ is messy.
seednumberprovider / randomLocks the sketch. Omit to follow SketchSeedProvider (Shuffle) or a mount-time random seed.
sketchColorstring#1f1d1aStroke color. Also tints primary/accent fills where relevant.
classNamestringundefinedPassed through to the root element.
styleCSSPropertiesundefinedPassed through to the root element.