A React tooltip component from Radix UI Primitives, part of an open-source UI component library for building high-quality, accessible design systems and web apps
Overall
score
96%
The TooltipProvider component manages global tooltip behavior and timing across all tooltips in your application. It provides context for delay timing, hover behavior, and skip delay functionality.
Global context provider that wraps your application or section containing tooltips.
/**
* Provider component for managing global tooltip behavior and timing
* @param children - Child components containing tooltips
* @param delayDuration - Duration in ms from pointer enter until tooltip opens (default: 700)
* @param skipDelayDuration - Duration in ms user has to enter another trigger without delay (default: 300)
* @param disableHoverableContent - When true, hovering content closes tooltip (default: false)
*/
interface TooltipProviderProps {
children: React.ReactNode;
delayDuration?: number;
skipDelayDuration?: number;
disableHoverableContent?: boolean;
}
const TooltipProvider: React.FC<TooltipProviderProps>;Usage Examples:
import { TooltipProvider } from "@radix-ui/react-tooltip";
// Basic provider with default settings
function App() {
return (
<TooltipProvider>
{/* Your tooltip components */}
</TooltipProvider>
);
}
// Custom delay timing
function CustomApp() {
return (
<TooltipProvider
delayDuration={500}
skipDelayDuration={200}
disableHoverableContent={false}
>
{/* Your tooltip components */}
</TooltipProvider>
);
}
// Disable hoverable content globally
function SimpleTooltips() {
return (
<TooltipProvider disableHoverableContent>
{/* Tooltips will close when pointer leaves trigger */}
</TooltipProvider>
);
}Controls the delay before tooltip opens when pointer enters trigger.
number700 (milliseconds)Controls how long user has to enter another trigger without delay.
number300 (milliseconds)Controls whether tooltip content can be hovered.
booleanfalsetrue, trying to hover content closes tooltip as pointer leaves triggerThe provider creates a context that manages:
const Provider: React.FC<TooltipProviderProps>;The Provider component is an alias for TooltipProvider for shorter import names.
type TooltipProviderProps = {
children: React.ReactNode;
delayDuration?: number;
skipDelayDuration?: number;
disableHoverableContent?: boolean;
};Install with Tessl CLI
npx tessl i tessl/npm-radix-ui--react-tooltipevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10