UNPKG

retro-react

Version:

A React component library for building retro-style websites

53 lines (52 loc) 1.51 kB
/// <reference types="react" /> import { ThemeUICSSObject } from 'theme-ui'; import { ComponentColors } from "../../utils/getColorScheme"; export interface ModalProps extends React.HTMLAttributes<HTMLDivElement> { /** * The library colors or hex color for background of the Modal. * * @default 'primary' */ color?: ComponentColors | 'greyscale' | string; /** * Whether the Modal is open or not. * * @default false * */ open?: boolean; /** * Enable backdrop for Modal. * * @default false */ backdrop?: boolean; /** * The title of the modal (displayed in title bar). * * @default undefined */ title?: string; /** * Callback fired when the Modal is closed. * * @default undefined * * @param event The event source of the callback. * You can pull out the new value by accessing `event.target.value` (string). */ onClose?: (event: Event) => void; sx?: ThemeUICSSObject; } /** * Modals are used to display content in a layer above the app. * They are centered on the screen and can be triggered by a button. * * Pressing the `Escape` key will close the Modal. * * @example * <Modal open={open} onClose={handleClose} title="Dialog"> * Content * </Modal> */ export declare const Modal: import("react").ForwardRefExoticComponent<ModalProps & import("react").RefAttributes<HTMLDivElement>>;