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.

60 lines 2.01 kB
import * as React from 'react'; import type { FloatingRootContext, Delay, FloatingContext } from "../types.js"; export interface FloatingDelayGroupProps { children?: React.ReactNode; /** * The delay to use for the group when it's not in the instant phase. */ delay: Delay; /** * An optional explicit timeout to use for the group, which represents when * grouping logic will no longer be active after the close delay completes. * This is useful if you want grouping to “last” longer than the close delay, * for example if there is no close delay at all. */ timeoutMs?: number; } /** * Experimental next version of `FloatingDelayGroup` to become the default * in the future. This component is not yet stable. * Provides context for a group of floating elements that should share a * `delay`. Unlike `FloatingDelayGroup`, `useDelayGroup` with this * component does not cause a re-render of unrelated consumers of the * context when the delay changes. * @see https://floating-ui.com/docs/FloatingDelayGroup * @internal */ export declare function FloatingDelayGroup(props: FloatingDelayGroupProps): React.JSX.Element; interface UseDelayGroupOptions { /** * Whether delay grouping should be enabled. * @default true */ enabled?: boolean; /** * Whether the trigger this hook is used in has opened the tooltip. */ open: boolean; } interface UseDelayGroupReturn { /** * The delay reference object. */ delayRef: React.MutableRefObject<Delay>; /** * Whether animations should be removed. */ isInstantPhase: boolean; /** * Whether a `<FloatingDelayGroup>` provider is present. */ hasProvider: boolean; } /** * Enables grouping when called inside a component that's a child of a * `FloatingDelayGroup`. * @see https://floating-ui.com/docs/FloatingDelayGroup * @internal */ export declare function useDelayGroup(context: FloatingRootContext | FloatingContext, options?: UseDelayGroupOptions): UseDelayGroupReturn; export {};