UNPKG

beta-parity-react

Version:

Beta Parity React Components

82 lines 2.4 kB
import React from 'react'; import { Placement } from '@floating-ui/react'; import './index.css'; /** * Props for the Tooltip component. * */ export interface TooltipProps { /** * The position of the tooltip relative to the target element. Based on the `Placement` type from the floating-ui library. * * Acceptable values include: * `top`, * `bottom`, * `left`, * `right`, * `top-start`, * `bottom-start`, * `left-start`, * `right-start`, * `top-end`, * `bottom-end`, * `left-end`, * `right-end` * * @default 'top' * @memberof Tooltip */ position?: Placement; /** * Determines if the tooltip is static (does not auto-adjust position) or dynamic. * If `true`, the tooltip will be a toggle tooltip. * * @default false * @memberof Tooltip */ isToggle?: boolean; /** * The text or content to display inside the tooltip. * * @memberof Tooltip */ content: string; /** * The delay time (ms) to show tooltip when hovering the tooltip * * @default 0 * @memberof Tooltip */ delay?: number; /** * The delay time (ms) to show tooltip when touching the tooltip on mobile * * If touchDelay is `undefined`, it will not show tooltip when touching the tooltip on mobile * * If touchDelay is valid (number), it will show tooltip when touching the tooltip on mobile with delay * * @memberof Tooltip */ touchDelay?: number; /** * If `true`, it is allows the user to move the cursor off the reference element and towards the floating element without it closing (e.g. it has interactive content inside). * * @default false * @memberof Tooltip */ isSafePolygon?: boolean; /** * The tooltip visibility will be controlled by the parent component. * * @default false * @memberof Tooltip */ controlledOpen?: boolean; } /** * **Parity Tooltip**. * * @see {@link https://beta-parity-react.vercel.app/tooltip Parity Tooltip} */ export declare const Tooltip: ({ children, className, content, position, isToggle, delay, touchDelay, isSafePolygon, controlledOpen, ...props }: TooltipProps & React.HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=index.d.ts.map