carbon-react
Version:
A library of reusable React components for easily building user interfaces.
33 lines (32 loc) • 1.4 kB
TypeScript
import React from "react";
import { TagProps } from "../../__internal__/utils/helpers/tags";
export interface ModalProps extends TagProps {
/**
* @private
* @internal
* @ignore
* Sets className for component. INTERNAL USE ONLY. */
className?: string;
/** Modal content */
children?: React.ReactNode;
/** The ARIA role to be applied to the modal */
ariaRole?: string;
/** Determines if the Esc Key closes the modal */
disableEscKey?: boolean;
/** Determines if the Dialog can be closed */
disableClose?: boolean;
/** Determines if the background is disabled when the modal is open */
enableBackgroundUI?: boolean;
/** A custom close event handler */
onCancel?: (ev: React.KeyboardEvent<HTMLElement> | KeyboardEvent) => void;
/** Sets the open state of the modal */
open: boolean;
/** Manually override the internal modal stacking order to set this as top */
topModalOverride?: boolean;
/** Enables the automatic restoration of focus to the element that invoked
* the modal when the modal is closed.
*/
restoreFocusOnClose?: boolean;
}
declare const Modal: ({ children, "data-element": dataElement, "data-role": dataRole, open, onCancel, disableEscKey, disableClose, enableBackgroundUI, topModalOverride, restoreFocusOnClose, ...rest }: ModalProps) => React.JSX.Element;
export default Modal;