UNPKG

@arolariu/components

Version:

🎨 70+ beautiful, accessible React components built on Base UI. TypeScript-first, CSS Modules styling, tree-shakeable, SSR-ready. Perfect for modern web apps, design systems & rapid prototyping. Zero config, maximum flexibility! ⚡

122 lines • 4.81 kB
import { Tooltip as BaseTooltip } from "@base-ui/react/tooltip"; import * as React from "react"; interface TooltipProviderProps { /** Tooltip content and triggers managed by the provider. @default undefined */ children: React.ReactNode; /** Delay in milliseconds before tooltip content becomes visible. @default undefined */ delayDuration?: number; } interface TooltipProps extends Omit<React.ComponentPropsWithRef<typeof BaseTooltip.Root>, "delay"> { /** Delay in milliseconds before tooltip content becomes visible. @default undefined */ delayDuration?: number; } interface TooltipTriggerProps extends Omit<React.ComponentPropsWithRef<typeof BaseTooltip.Trigger>, "className"> { /** Additional CSS classes merged with the tooltip trigger styles. @default undefined */ className?: string; /** Backward-compatible child-slot API that maps the child element to `render`. @default false @deprecated Prefer Base UI's `render` prop. */ asChild?: boolean; } interface TooltipContentProps extends Omit<React.ComponentPropsWithRef<typeof BaseTooltip.Popup>, "className"> { /** Additional CSS classes merged with the tooltip popup styles. @default undefined */ className?: string; /** The offset in pixels between the trigger and the tooltip popup. @default 4 */ sideOffset?: number; /** Preferred side on which the tooltip should appear. @default "top" */ side?: "top" | "right" | "bottom" | "left"; } /** * Provides a compatibility wrapper for grouping tooltip triggers and content. * * @remarks * - Renders no DOM element by default and returns its children directly * - Built on {@link https://base-ui.com/react/components/tooltip | Base UI Tooltip} * - Does not expose a `render` prop because it is a pass-through provider shim * - Styling via CSS Modules with `--ac-*` custom properties through descendant components * * @example Basic usage * ```tsx * <TooltipProvider> * <Tooltip> * <TooltipTrigger>Hover</TooltipTrigger> * <TooltipContent>Details</TooltipContent> * </Tooltip> * </TooltipProvider> * ``` * * @see {@link https://base-ui.com/react/components/tooltip | Base UI Documentation} */ declare const TooltipProvider: { ({ children }: Readonly<TooltipProviderProps>): React.ReactNode; displayName: string; }; /** * Coordinates tooltip timing, open state, and accessibility semantics. * * @remarks * - Renders no DOM element by default and coordinates descendant tooltip parts * - Built on {@link https://base-ui.com/react/components/tooltip | Base UI Tooltip} * - Supports composition through descendant `render` props * - Styling via CSS Modules with `--ac-*` custom properties * * @example Basic usage * ```tsx * <Tooltip> * <TooltipTrigger>Hover</TooltipTrigger> * <TooltipContent>Details</TooltipContent> * </Tooltip> * ``` * * @see {@link https://base-ui.com/react/components/tooltip | Base UI Documentation} */ declare function Tooltip(props: Readonly<Tooltip.Props>): React.ReactElement; declare namespace Tooltip { var displayName: string; } /** * Anchors tooltip behavior to an interactive trigger element. * * @remarks * - Renders a `<button>` element by default * - Built on {@link https://base-ui.com/react/components/tooltip | Base UI Tooltip} * - Supports the `render` prop for element composition * - Styling via CSS Modules with `--ac-*` custom properties * * @example Basic usage * ```tsx * <TooltipTrigger>Hover</TooltipTrigger> * ``` * * @see {@link https://base-ui.com/react/components/tooltip | Base UI Documentation} */ declare const TooltipTrigger: React.ForwardRefExoticComponent<Omit<TooltipTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>; /** * Renders positioned tooltip content inside a portal. * * @remarks * - Renders a `<div>` element by default * - Built on {@link https://base-ui.com/react/components/tooltip | Base UI Tooltip} * - Supports the `render` prop for element composition * - Styling via CSS Modules with `--ac-*` custom properties * * @example Basic usage * ```tsx * <TooltipContent>Details</TooltipContent> * ``` * * @see {@link https://base-ui.com/react/components/tooltip | Base UI Documentation} */ declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>; declare namespace Tooltip { type Props = TooltipProps; type State = BaseTooltip.Root.State; } declare namespace TooltipTrigger { type Props = TooltipTriggerProps; type State = BaseTooltip.Trigger.State; } declare namespace TooltipContent { type Props = TooltipContentProps; type State = BaseTooltip.Popup.State; } export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger }; //# sourceMappingURL=tooltip.d.ts.map