@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.
21 lines • 1.14 kB
TypeScript
import { ReactStore } from '@base-ui-components/utils/store';
import { BaseUIChangeEventDetails } from "../../types/index.js";
import { PopupStoreContext, PopupStoreSelectors, PopupStoreState } from "../../utils/popups/index.js";
import { FloatingRootStore } from "../components/FloatingRootStore.js";
export interface UseSyncedFloatingRootContextOptions<State extends PopupStoreState<any>> {
popupStore: ReactStore<State, PopupStoreContext<any>, PopupStoreSelectors>;
/**
* Whether to prevent the auto-emitted `openchange` event.
*/
noEmit?: boolean;
/**
* Whether the Popup element is passed to Floating UI as the floating element instead of the default Positioner.
*/
treatPopupAsFloatingElement?: boolean;
onOpenChange(open: boolean, eventDetails: BaseUIChangeEventDetails<string>): void;
}
/**
* Initializes a FloatingRootStore that is kept in sync with the provided PopupStore.
* The new instance is created only once and updated on every render.
*/
export declare function useSyncedFloatingRootContext<State extends PopupStoreState<any>>(options: UseSyncedFloatingRootContextOptions<State>): FloatingRootStore;