MuiDialog
Reference
- The
MuiDialogcomponent is a customizable dialog box. - It allows for flexible configuration of headers, footers, and content.
Props
-
dialogTitle- Type:
ReactNode - Description: The title displayed in the dialog header.
- Type:
-
dialogWidth- Type:
string - Description: Sets the width of the dialog.
- Type:
-
dialogStyles- Type:
object - Description: Custom styles for the dialog.
- Type:
-
dialogHeaderButton- Type:
ReactNode - Description: A button or element displayed in the header, typically for actions like closing the dialog.
- Type:
-
leftFooter- Type:
ReactNode - Description: Content displayed on the left side of the footer.
- Type:
-
rightFooter- Type:
ReactNode - Description: Content displayed on the right side of the footer.
- Type:
-
children- Type:
ReactNode - Description: The main content of the dialog.
- Type:
-
showDialog- Type:
boolean - Default:
true - Description: Controls the visibility of the dialog.
- Type:
-
showFooter- Type:
boolean - Default:
true - Description: Toggles the visibility of the footer.
- Type:
-
dialogHeaderStyle- Type:
object - Default:
{} - Description: Custom styles for the dialog header.
- Type:
-
dialogTitleStyles- Type:
object - Default:
{} - Description: Custom styles for the dialog title.
- Type:
-
dialogContainerStyle- Type:
object - Default:
{} - Description: Custom styles for the dialog container.
- Type:
Usage Example
function Example(pageContext) {
const { protrakComponents } = React.useContext(customWidgetContext);
const { MuiDialog } = protrakComponents;
return(
<MuiDialog
dialogTitle="Dialog Title"
dialogHeaderButton={<button>Close</button>}
leftFooter={<span>Left Footer</span>}
rightFooter={<button>Submit</button>}
dialogWidth="500px"
>
<p>This is the dialog content.</p>
</MuiDialog>
);
}
- This renders a dialog with a title, a close button in the header, footer content, and custom width.