Guide
Components
Popup Modal

Popup Modal Component Usage

ℹ️

The PopupModal component is used to render a modal that can be opened and closed. The PopupModal component requires this props:

ℹ️

Here is an example of how to use the PopupModal component:

import React, { useState } from "react";
import { PopupModal, Button } from "@/@core";
 
const PopupModalExample = () => {
  const [show, setShow] = useState(false);
 
  return (
    <div>
      <Button onClick={() => setShow(!show)}>Open Modal</Button>
      <PopupModal
        show={show}
        onClose={() => setShow(false)}
        title="Modal Title"
        titleSize="lg"
        titleClassName="text-red-500"
        closeIconClassName="text-red-500"
        bodyClassName="bg-red-500"
        overlayClassName="bg-red-500"
      >
        <div className="p-4">
          <p className="text-white">Modal Content</p>
        </div>
      </PopupModal>
    </div>
  );
};
ℹ️

The PopupModal component also has these optional props:

0NameTypeDefaultDescription
1showbooleanfalseBoolean value that determines whether the modal is open or closed required
2onClosefunction() => {}Function that is called when the modal is closed required
3childrennodenullThe content of the modal required
4titlestringnullThe title of the modal
5classNamestringnullThe class name of the modal
6titleSizestringmdThe size of the title, can be sm, md, lg, or xl
7titleClassNamestringnullThe class name of the title
8closeIconClassNamestringnullThe class name of the close icon
9bodyClassNamestringnullThe class name of the body
10overlayClassNamestringnullThe class name of the overlay
ℹ️

Node: The PopupModal also support the other props that are supported by an HTML div element.