@intility/bifrost-react
Version:
React library for Intility's design system, Bifrost.
46 lines (45 loc) • 1.6 kB
TypeScript
import React from "react";
export interface ModalProps extends React.AriaAttributes {
/** Control modal open state */
isOpen: boolean;
/** Callback triggered by ESC, overlay click or close button */
onRequestClose?: () => void;
/** Callback for dialog's onCancel event */
onCancel?: (e: React.SyntheticEvent<HTMLDialogElement, Event>) => void;
/** Optional header title */
header?: React.ReactNode;
/** Remove default padding inside modal content area */
noPadding?: boolean;
/** Prevent rendering a close button */
noCloseButton?: boolean;
/** Prevent close request on overlay click */
noCloseOnOverlayClick?: boolean;
/**
* Prevent close request on ESC keypress
*
* (Note: By disabling the esc key from closing the modal you may introduce an accessibility issue)
*/
noCloseOnEsc?: boolean;
/** Optional max-width as a number in px (200), or a css length string ('200px'), default '100%' */
width?: number | string;
/** CSS class name(s) */
className?: string;
/** Inline style object */
style?: React.CSSProperties;
/** Modal content */
children?: React.ReactNode;
/** Remove default background color */
transparent?: boolean;
}
/**
* Dialog popup with a fullscreen backdrop overlay
*
* @see https://bifrost.intility.com/react/modal
*
* @example
* <Modal isOpen={open} onRequestClose={() => setOpen(false)}>
* Modal content
* </Modal>
*/
declare const Modal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<HTMLDialogElement>>;
export default Modal;