UNPKG

@base-ui-components/react

Version:

Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.

35 lines 1.21 kB
import * as React from 'react'; import { useAnchorPositioning, type Side, type Align } from "../../utils/useAnchorPositioning.js"; import type { BaseUIComponentProps } from "../../utils/types.js"; /** * Positions the tooltip against the trigger. * Renders a `<div>` element. * * Documentation: [Base UI Tooltip](https://base-ui.com/react/components/tooltip) */ export declare const TooltipPositioner: React.ForwardRefExoticComponent<TooltipPositionerProps & React.RefAttributes<HTMLDivElement>>; export interface TooltipPositionerState { /** * Whether the tooltip is currently open. */ open: boolean; side: Side; align: Align; anchorHidden: boolean; /** * Whether CSS transitions should be disabled. */ instant: string | undefined; } export interface TooltipPositionerProps extends BaseUIComponentProps<'div', TooltipPositioner.State>, Omit<useAnchorPositioning.SharedParameters, 'side'> { /** * Which side of the anchor element to align the popup against. * May automatically change to avoid collisions. * @default 'top' */ side?: Side; } export declare namespace TooltipPositioner { type State = TooltipPositionerState; type Props = TooltipPositionerProps; }