@coreui/react
Version:
UI Components Library for React.js
77 lines (76 loc) • 2.38 kB
TypeScript
import React, { HTMLAttributes } from 'react';
export interface CModalProps extends HTMLAttributes<HTMLDivElement> {
/**
* Align the modal in the center or top of the screen.
*/
alignment?: 'top' | 'center';
/**
* Apply a backdrop on body while modal is open.
*/
backdrop?: boolean | 'static';
/**
* A string of all className you want applied to the base component.
*/
className?: string;
/**
* Appends the react modal to a specific element. You can pass an HTML element or function that returns a single element. By default `document.body`.
*
* @since 5.3.0
*/
container?: DocumentFragment | Element | (() => DocumentFragment | Element | null) | null;
/**
* @ignore
*/
duration?: number;
/**
* Puts the focus on the modal when shown.
*
* @since 4.10.0
*/
focus?: boolean;
/**
* Set modal to covers the entire user viewport.
*/
fullscreen?: boolean | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
/**
* Closes the modal when escape key is pressed.
*/
keyboard?: boolean;
/**
* Callback fired when the component requests to be closed.
*/
onClose?: () => void;
/**
* Callback fired when the component requests to be closed.
*/
onClosePrevented?: () => void;
/**
* Callback fired when the modal is shown, its backdrop is static and a click outside the modal or an escape key press is performed with the keyboard option set to false.
*/
onShow?: () => void;
/**
* Generates modal using createPortal.
*/
portal?: boolean;
/**
* Create a scrollable modal that allows scrolling the modal body.
*/
scrollable?: boolean;
/**
* Size the component small, large, or extra large.
*/
size?: 'sm' | 'lg' | 'xl';
/**
* Remove animation to create modal that simply appear rather than fade in to view.
*/
transition?: boolean;
/**
* By default the component is unmounted after close animation, if you want to keep the component mounted set this property to false.
*/
unmountOnClose?: boolean;
/**
* Toggle the visibility of modal component.
*/
visible?: boolean;
}
export declare const CModal: React.ForwardRefExoticComponent<CModalProps & React.RefAttributes<HTMLDivElement>>;