@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.
40 lines • 1.45 kB
TypeScript
import * as React from 'react';
import { InteractionType } from '@base-ui-components/utils/useEnhancedClickHandler';
import { type BaseUIComponentProps } from "../../utils/types.js";
import { type TransitionStatus } from "../../utils/useTransitionStatus.js";
/**
* A container for the dialog contents.
* Renders a `<div>` element.
*
* Documentation: [Base UI Dialog](https://base-ui.com/react/components/dialog)
*/
export declare const DialogPopup: React.ForwardRefExoticComponent<DialogPopup.Props & React.RefAttributes<HTMLDivElement>>;
export declare namespace DialogPopup {
interface Props extends BaseUIComponentProps<'div', State> {
/**
* Determines the element to focus when the dialog is opened.
* By default, the first focusable element is focused.
*/
initialFocus?: React.RefObject<HTMLElement | null> | ((interactionType: InteractionType) => React.RefObject<HTMLElement | null>);
/**
* Determines the element to focus when the dialog is closed.
* By default, focus returns to the trigger.
*/
finalFocus?: React.RefObject<HTMLElement | null>;
}
interface State {
/**
* Whether the dialog is currently open.
*/
open: boolean;
transitionStatus: TransitionStatus;
/**
* Whether the dialog is nested within a parent dialog.
*/
nested: boolean;
/**
* Whether the dialog has nested dialogs open.
*/
nestedDialogOpen: boolean;
}
}