Cursor Tooltip
Tactile cursor-following tooltip with continuous exponential lerp tracking, boundary viewport collision clamping, multi-variant tokens, and zero Framer Motion dependencies.
Interactive Specification & Studio
Exponential Cursor Smoothing
Move your pointer freely across this sandbox. The tooltip trails your cursor using high-performance exponential decay math with viewport collision clamping.
Quick Start & Consumer Example
Copy-paste ready implementation for React (.tsx). Automatically updates when you modify parameters in the Workbench above.
import React from 'react';
import { CursorTooltip } from './CursorTooltip';
export default function CursorTooltipDemo() {
return (
<div className="flex min-h-[400px] w-full items-center justify-center p-8 bg-background">
<CursorTooltip
content="Explore Showcase"
springDamping={20}
direction="bottom-right"
offsetX={16}
offsetY={16}
variant="frosted"
collisionPadding={12}
className="rounded-2xl border border-border bg-card/80 p-8 text-center shadow-xl hover:border-primary/50 transition-colors"
>
<span className="text-[10px] font-mono font-bold uppercase text-primary mb-2 inline-block">Hover Sandbox</span>
<h3 className="text-lg font-bold text-foreground">Interactive Target Zone</h3>
<p className="mt-1 text-xs text-muted-foreground">Move pointer over this card to track trailing tooltip</p>
</CursorTooltip>
</div>
);
}
Props & Configuration
Exhaustive parameter contract for Cursor Tooltip. Validated in the live Studio workbench above and statically checked across all 13 ecosystem templates.
| Prop | Type | Default | Description |
|---|---|---|---|
content | string | Explore Showcase | Text or badge label displayed inside the trailing tooltip. |
springDamping | number | 20 | Exponential smoothing factor for trailing cursor physics (higher = snappy, lower = trailing glide). |
offsetX | number | 16 | Horizontal distance from cursor to tooltip origin in pixels. |
offsetY | number | 16 | Vertical distance from cursor to tooltip origin in pixels. |
variant | select | frosted | Visual token styling of the floating tooltip badge. |
direction | select | bottom-right | Directional orientation and quadrant placement relative to cursor pointer. |
collisionPadding | number | 12 | Safe margin in pixels between tooltip and viewport edges to prevent clipping. |
Text or badge label displayed inside the trailing tooltip.
Exponential smoothing factor for trailing cursor physics (higher = snappy, lower = trailing glide).
Horizontal distance from cursor to tooltip origin in pixels.
Vertical distance from cursor to tooltip origin in pixels.
Visual token styling of the floating tooltip badge.
Directional orientation and quadrant placement relative to cursor pointer.
Safe margin in pixels between tooltip and viewport edges to prevent clipping.
Component Source
Component source definition for React (.tsx). Toggle between the clean wrapper and the standalone ejected engine micro-kernel.
import * as React from 'react';
import {
CursorTooltip as CoreCursorTooltip,
type CursorTooltipProps as CoreCursorTooltipProps,
type CursorTooltipVariant,
} from '@exhuma/core';
import { clsx } from 'clsx';
export type { CursorTooltipVariant };
export interface CursorTooltipProps extends CoreCursorTooltipProps {
className?: string;
}
export const CursorTooltip = React.forwardRef<HTMLDivElement, CursorTooltipProps>(
(
{
content = 'Explore Showcase',
springDamping = 20,
direction = 'bottom-right',
offsetX = 16,
offsetY = 16,
variant = 'frosted',
collisionPadding = 12,
className,
children,
...props
},
ref
) => {
return (
<CoreCursorTooltip
content={content}
springDamping={springDamping}
direction={direction as any}
offsetX={offsetX}
offsetY={offsetY}
variant={variant as CursorTooltipVariant}
collisionPadding={collisionPadding}
className={clsx('relative inline-block cursor-pointer', className)}
{...props}
>
<div ref={ref}>{children}</div>
</CoreCursorTooltip>
);
}
);
CursorTooltip.displayName = 'CursorTooltip';
Lifecycle Safety & Performance
Engineered for high-frequency user interactions with zero memory leaks.
Deterministic Cleanup
GPU Compositor Acceleration
will-change: transform without triggering browser layout recalculations.Accessibility Considerations
Fully compliant with WCAG guidelines and respects user motion preferences.
prefers-reduced-motion Support
prefers-reduced-motion: reduce enabled in their operating system, Exhuma components automatically disable 3D gyroscope tilt and spring animations, rendering static accessible content.