@buun_group/brutalist-ui
Version:
A brutalist-styled component library
37 lines (36 loc) • 1.49 kB
TypeScript
/**
* @module Tooltip
* @description A tooltip component for displaying contextual information on hover or focus. Automatically positions itself to stay within viewport bounds.
*/
import React, { CSSProperties } from 'react';
export type TooltipPosition = 'top' | 'bottom' | 'left' | 'right' | 'auto';
export type TooltipTrigger = 'hover' | 'click' | 'focus' | 'manual';
export interface TooltipProps {
/** The content to display inside the tooltip */
content: React.ReactNode;
/** The element that triggers the tooltip */
children: React.ReactElement;
/** Position of the tooltip relative to the trigger */
position?: TooltipPosition;
/** How the tooltip is triggered */
trigger?: TooltipTrigger;
/** Delay before showing tooltip (ms) */
showDelay?: number;
/** Delay before hiding tooltip (ms) */
hideDelay?: number;
/** Whether the tooltip is currently visible (for manual trigger) */
visible?: boolean;
/** Callback when visibility changes (for manual trigger) */
onVisibilityChange?: (visible: boolean) => void;
/** Whether to show an arrow pointing to the trigger */
showArrow?: boolean;
/** Additional CSS classes */
className?: string;
/** Custom styles to apply to the tooltip */
style?: CSSProperties;
/** Whether the tooltip is disabled */
disabled?: boolean;
/** Maximum width of the tooltip */
maxWidth?: number;
}
export declare const Tooltip: React.FC<TooltipProps>;