@rtdui/dialogs
Version:
React dialogs base on Rtdui components
48 lines (47 loc) • 1.49 kB
TypeScript
export interface DialogProps extends Omit<React.ComponentPropsWithoutRef<"div">, "title" | "content"> {
/** Called when close button is clicked */
onClose?: (result?: any) => void;
/** Dialog title, displayed before body */
title?: React.ReactNode;
/** Dialog message, place main text here */
children?: React.ReactNode;
/** Dialog actions */
actions?: React.ReactNode;
/** Determines whether close button should be visible in title
* @default true
*/
withCloseButton?: boolean;
/** full screen dialog */
fullScreen?: boolean;
/** dialog mode
* @default "dialog"
*/
mode?: "alert" | "prompt" | "confirm" | "dialog";
/** confirm button text for confirm or prompt mode
* @default "OK"
*/
confirmLabel?: string;
/** cancel button text for confirm or prompt mode
* @default "Cancel"
*/
cancelLabel?: string;
/** close button text for alert mode
* @default "Close"
*/
closeLabel?: string;
/** default prompt text for prompt mode
* @default ""
*/
defaultPrompt?: string;
slots?: {
closeBtn?: string;
dialogTitle?: string;
title?: string;
dialogContent?: string;
dialogAction?: string;
okBtn?: string;
cancelBtn?: string;
};
dialogId?: string;
}
export declare const Dialog: import("react").ForwardRefExoticComponent<DialogProps & import("react").RefAttributes<HTMLDivElement>>;