UNPKG

@vtex/admin-ui

Version:

> VTEX admin component library

49 lines (48 loc) 1.5 kB
import type { ComponentPropsWithRef, FunctionComponentElement, ReactNode } from 'react'; import React from 'react'; import type { PopoverState } from 'reakit/ts'; /** * Popup that displays information related to an element on :focus (by keyboard) or :hover (by mouse). * @example * ```jsx * import { Tooltip, Button, IconClose } from `@vtex/admin-ui` * <Tooltip label="Close something"> * <Button icon={<IconClose />} variant="tertiary" /> * </Tooltip> * ``` // */ export declare const Tooltip: import("@vtex/admin-ui-react").AdminUIJsxComponent<React.ExoticComponent<{ children?: ReactNode; }>, TooltipOptions, {}>; declare type TooltipPlacement = Pick<PopoverState, 'placement'>['placement']; export interface TooltipOptions { /** * The element that triggers the tooltip */ children: FunctionComponentElement<unknown>; /** * Label shown inside the tooltip */ label: ReactNode; /** * The placement of the tooltip relative to its children * @default 'top' */ placement?: TooltipPlacement; /** * Whether the tooltip is visible or not * @default false */ visible?: boolean; /** * Whether or not the tooltip popover should have position set to fixed. * @default false */ fixed?: boolean; /** * reakit base-id */ baseId?: string; } export declare type TooltipProps = ComponentPropsWithRef<typeof Tooltip>; export {};