UNPKG

retro-react

Version:

A React component library for building retro-style websites

64 lines (63 loc) 1.84 kB
/** @jsxImportSource theme-ui */ import React from 'react'; import { ThemeUICSSObject } from 'theme-ui'; export declare type TooltipPositions = 'top' | 'bottom' | 'left' | 'right'; export declare type TooltipVariants = 'default' | 'help' | 'warning' | 'info'; export interface TooltipProps { /** * The label for the Tooltip. * * @default undefined */ label?: string; /** * The children of the Tooltip. * * @default undefined */ children: React.ReactElement; /** * The visual variant of the Tooltip. * - default: Standard yellow info tooltip (Windows 95/98 style) * - help: Help tooltip with question mark styling * - warning: Warning tooltip with alert styling * - info: Info tooltip with blue styling * * @default 'default' */ variant?: TooltipVariants; /** * The position of the Tooltip. * * @default 'top' */ position?: TooltipPositions; /** * The delay in milliseconds before the Tooltip appears. * * @default 500 */ delay?: number; sx?: ThemeUICSSObject; } /** * Retro-themed tooltips inspired by classic Windows 95/98 help bubbles. * * Features authentic Windows tooltip styling: * - Default: Classic yellow info bubble (like Windows help tooltips) * - Help: Question mark style help tooltip * - Warning: Alert style warning tooltip * - Info: Blue informational tooltip * * @example * // Classic yellow Windows tooltip * <Tooltip label="This is a help tooltip"> * <Button>Hover me</Button> * </Tooltip> * * // Warning tooltip * <Tooltip label="This action cannot be undone" variant="warning"> * <Button>Delete</Button> * </Tooltip> */ export declare const Tooltip: React.FC<TooltipProps>;