@nexusui/components
Version:
These are custom components specially-developed for NexusUI applications. They will make your life easier by giving you out-of-the-box implementations for various high-level UI elements that you can drop directly into your application.
51 lines (50 loc) • 1.96 kB
TypeScript
import { FC, ReactNode } from 'react';
import type { DialogProps as MuiDialogProps } from '@mui/material/Dialog';
import type { DialogContentProps } from '@mui/material/DialogContent';
import type { DialogActionsProps } from '@mui/material/DialogActions';
import type { DialogTitleProps } from '@mui/material/DialogTitle';
import { ButtonPropsWithTestId } from '../models/MuiExtension.type';
export interface DialogProps extends Omit<MuiDialogProps, 'title'> {
/**
* If it passed title, it will render DialogTitle
* @default null
*/
title?: ReactNode;
/**
* If it passed footer, it will render footer wrapped by DialogActions the priority is footer > actions
* @default null
*/
footer?: ReactNode;
/**
* If true, dividing lines will be drawn between dialog content, header and footer.
* @default false
*/
dividers?: DialogContentProps['dividers'];
/**
* If it passed actions, it will render actions Button wrapped by DialogActions,
* and the actions will be rendered on the left side
* @default []
*/
leftActions?: ReadonlyArray<ButtonPropsWithTestId | ReactNode>;
/**
* If it passed actions, it will render actions Button wrapped by DialogActions,
* and the actions will be rendered on the right side.
*/
rightActions?: ReadonlyArray<ButtonPropsWithTestId | ReactNode>;
/**
* The props of DialogTitle, you can pass any props of DialogTitle
* @default {}
*/
DialogTitleProps?: Omit<DialogTitleProps, 'children'>;
/**
* the props of DialogContent, you can pass any props of DialogContent
* @default {}
*/
DialogContentProps?: Omit<DialogContentProps, 'children' | 'dividers'>;
/**
* the props of DialogActions, you can pass any props of DialogActions
* @default {}
*/
DialogActionsProps?: Omit<DialogActionsProps, 'children'>;
}
export declare const Dialog: FC<DialogProps>;