diff --git a/components/modal/react/modal/Modal.jsx b/components/modal/react/modal/Modal.jsx
new file mode 100644
index 0000000..08c42b1
--- /dev/null
+++ b/components/modal/react/modal/Modal.jsx
@@ -0,0 +1,237 @@
+import React, { useEffect, useRef } from "react"
+import { IoMdClose } from "react-icons/io"
+
+// Modal Context
+const ModalContext = React.createContext(undefined)
+
+// Main Modal Component
+const Modal = ({
+ open,
+ onClose,
+ children,
+ size = "md",
+ closeOnOverlay = true,
+ closeOnEsc = true,
+ showCloseButton = true,
+}) => {
+ const modalRef = useRef(null)
+ const previousActiveElement = useRef(null)
+
+ // Size classes
+ const sizeClasses = {
+ sm: "max-w-sm",
+ md: "max-w-md",
+ lg: "max-w-lg",
+ xl: "max-w-xl",
+ full: "max-w-full mx-4",
+ }
+
+ // Handle ESC key
+ useEffect(() => {
+ if (!open || !closeOnEsc) return
+
+ const handleEsc = e => {
+ if (e.key === "Escape") {
+ onClose()
+ }
+ }
+
+ document.addEventListener("keydown", handleEsc)
+ return () => document.removeEventListener("keydown", handleEsc)
+ }, [open, closeOnEsc, onClose])
+
+ // Focus management
+ useEffect(() => {
+ if (open) {
+ previousActiveElement.current = document.activeElement
+ modalRef.current?.focus()
+ } else {
+ previousActiveElement.current?.focus()
+ }
+ }, [open])
+
+ // Prevent body scroll when modal is open
+ useEffect(() => {
+ if (open) {
+ document.body.style.overflow = "hidden"
+ } else {
+ document.body.style.overflow = ""
+ }
+ return () => {
+ document.body.style.overflow = ""
+ }
+ }, [open])
+
+ // Focus trap
+ const handleTabKey = e => {
+ if (e.key !== "Tab") return
+
+ const focusableElements = modalRef.current?.querySelectorAll(
+ 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
+ )
+
+ if (!focusableElements || focusableElements.length === 0) return
+
+ const firstElement = focusableElements[0]
+ const lastElement = focusableElements[focusableElements.length - 1]
+
+ if (e.shiftKey) {
+ if (document.activeElement === firstElement) {
+ lastElement.focus()
+ e.preventDefault()
+ }
+ } else {
+ if (document.activeElement === lastElement) {
+ firstElement.focus()
+ e.preventDefault()
+ }
+ }
+ }
+
+ if (!open) return null
+
+ return (
+
+
+ {/* Overlay */}
+
+
+ {/* Modal */}
+
+ {showCloseButton && (
+
+ )}
+ {children}
+
+
+
+
+
+ )
+}
+
+// Modal Header
+const ModalHeader = ({ children, className = "" }) => {
+ return (
+
+
+ {children}
+
+
+ )
+}
+
+// Modal Body
+const ModalBody = ({ children, className = "" }) => {
+ return {children}
+}
+
+// Modal Footer
+const ModalFooter = ({ children, className = "" }) => {
+ return (
+
+ {children}
+
+ )
+}
+
+// Attach compound components
+Modal.Header = ModalHeader
+Modal.Body = ModalBody
+Modal.Footer = ModalFooter
+
+// Demo Component
+const ModalDemo = () => {
+ const [previewOpen, setPreviewOpen] = React.useState(false)
+
+ return (
+
+
+ {/* Preview Modal Trigger */}
+
+
+ {/* Preview Modal */}
+
setPreviewOpen(false)}
+ size="lg"
+ >
+ Image Preview
+
+
+ Preview Content
+
+
+
+ Beautiful Gradient
+
+
+ This is an example of a content preview modal. You can display
+ images, videos, or any other content here.
+
+
+
+
+
+
+
+
+
+ )
+}
+
+export default ModalDemo
+export { Modal }
diff --git a/components/modal/react/modal/README.md b/components/modal/react/modal/README.md
new file mode 100644
index 0000000..8690b1a
--- /dev/null
+++ b/components/modal/react/modal/README.md
@@ -0,0 +1,290 @@
+# Accessible Modal Component
+
+A reusable modal component for displaying forms, confirmation boxes, and alerts. Should include accessibility features, animations, and flexible content placement.
+
+## Features
+
+- **Full Accessibility (WCAG Compliant)**
+ - Focus trap with keyboard navigation
+ - Automatic focus management
+ - ESC key to close
+ - Proper ARIA attributes
+ - Screen reader support
+
+- **Smooth Animations**
+ - Fade-in overlay
+ - Scale-in modal entrance
+ - CSS-based for optimal performance
+
+- **Flexible**
+ - Compound component pattern (Header, Body, Footer)
+ - Multiple size variants
+ - Customizable behaviors
+
+- **Responsive Design**
+ - Mobile-friendly
+ - Prevents body scroll when open
+ - Adaptive sizing
+
+- **Use Cases**
+ - Confirmation modals
+ - Form popups (login, create, edit)
+ - Alert notifications
+ - Content/image previews
+
+## Installation
+
+No external dependencies required beyond React and Tailwind CSS.
+
+1. Copy the component files to your project
+2. Ensure Tailwind CSS is configured in your project
+3. Import and use the component
+
+## Usage
+
+### Basic Example
+
+```jsx
+import { useState } from "react"
+import Modal from "./components/Modal"
+
+function App() {
+ const [open, setOpen] = useState(false)
+
+ return (
+ <>
+
+
+ setOpen(false)}>
+ Modal Title
+
+ This is the modal content.
+
+
+
+
+
+ >
+ )
+}
+```
+
+### Confirmation Modal
+
+```jsx
+ setConfirmOpen(false)} size="sm">
+ Delete Item?
+
+
+ Are you sure you want to delete this item? This action cannot be undone.
+
+
+
+
+
+
+
+```
+
+### Form Modal
+
+```jsx
+ setFormOpen(false)} size="md">
+ Create Account
+
+
+
+
+
+
+
+
+```
+
+### Alert Modal
+
+```jsx
+ setAlertOpen(false)} size="sm">
+ Success!
+
+ Your changes have been saved successfully.
+
+
+
+
+
+```
+
+### Without Close Button
+
+```jsx
+ setOpen(false)}
+ showCloseButton={false}
+ closeOnOverlay={false}
+ closeOnEsc={false}
+>
+ Important Message
+
+ This modal requires explicit action.
+
+
+
+
+
+```
+
+## Props Documentation
+
+### Modal Props
+
+| Prop | Type | Required | Default | Description |
+| ----------------- | ---------------------------------------- | -------- | ------- | ---------------------------------------------------------------- |
+| `open` | `boolean` | ✅ | - | Controls the visibility of the modal |
+| `onClose` | `() => void` | ✅ | - | Callback function triggered when the modal should close |
+| `children` | `React.ReactNode` | ✅ | - | Modal content (typically Modal.Header, Modal.Body, Modal.Footer) |
+| `size` | `'sm' \| 'md' \| 'lg' \| 'xl' \| 'full'` | ❌ | `'md'` | Sets the maximum width of the modal |
+| `closeOnOverlay` | `boolean` | ❌ | `true` | Whether clicking the overlay/backdrop closes the modal |
+| `closeOnEsc` | `boolean` | ❌ | `true` | Whether pressing the ESC key closes the modal |
+| `showCloseButton` | `boolean` | ❌ | `true` | Whether to display the X close button in the top-right corner |
+
+### Size Options
+
+- `sm` - max-width: 24rem (384px)
+- `md` - max-width: 28rem (448px)
+- `lg` - max-width: 32rem (512px)
+- `xl` - max-width: 36rem (576px)
+- `full` - Full width with margin
+
+### Modal.Header Props
+
+| Prop | Type | Required | Default | Description |
+| ----------- | ----------------- | -------- | ------- | ------------------------------------------ |
+| `children` | `React.ReactNode` | ✅ | - | Header content (typically the modal title) |
+| `className` | `string` | ❌ | `''` | Additional CSS classes to apply |
+
+### Modal.Body Props
+
+| Prop | Type | Required | Default | Description |
+| ----------- | ----------------- | -------- | ------- | ------------------------------- |
+| `children` | `React.ReactNode` | ✅ | - | Main modal content |
+| `className` | `string` | ❌ | `''` | Additional CSS classes to apply |
+
+### Modal.Footer Props
+
+| Prop | Type | Required | Default | Description |
+| ----------- | ----------------- | -------- | ------- | ----------------------------------------- |
+| `children` | `React.ReactNode` | ✅ | - | Footer content (typically action buttons) |
+| `className` | `string` | ❌ | `''` | Additional CSS classes to apply |
+
+## Customization Guide
+
+### Styling
+
+The component uses Tailwind CSS classes. You can customize the appearance by:
+
+1. **Modifying default classes** in the component file
+2. **Passing custom classes** via the `className` prop on sub-components
+3. **Overriding Tailwind theme** in your `tailwind.config.js`
+
+### Custom Overlay Color
+
+```jsx
+// Edit the overlay div in the Modal component
+
+```
+
+### Custom Animation Duration
+
+```jsx
+// Edit the style tag in the Modal component
+
+```
+
+### Custom Header Styling
+
+```jsx
+
+ Custom Styled Header
+
+```
+
+### Custom Footer Layout
+
+```jsx
+
+ {" "}
+ {/* Instead of justify-end */}
+
+
+
+
+
+
+```
+
+### Adding New Size Options
+
+Edit the `sizeClasses` object in the Modal component:
+
+```jsx
+const sizeClasses = {
+ sm: "max-w-sm",
+ md: "max-w-md",
+ lg: "max-w-lg",
+ xl: "max-w-xl",
+ "2xl": "max-w-2xl", // Add new size
+ full: "max-w-full mx-4",
+}
+```
+
+## Dependencies
+
+- **React** (v16.8+) - For hooks support
+- **Tailwind CSS** (v3.0+) - For styling
+- **react-icons** - For the close icon (X)
diff --git a/components/modal/react/modal/component.json b/components/modal/react/modal/component.json
new file mode 100644
index 0000000..448b555
--- /dev/null
+++ b/components/modal/react/modal/component.json
@@ -0,0 +1,113 @@
+{
+ "name": "modal",
+ "category": "overlay",
+ "framework": "react",
+ "tags": ["modal", "dialog", "confirm", "overlay", "popup"],
+ "author": "Mahmud1087",
+ "license": "MIT",
+ "version": "1.0.0",
+ "preview": "A reusable modal/dialog component for displaying forms, confirmation boxes, and alerts. Should include accessibility features, animations, and flexible content placement.",
+ "demoUrl": "",
+ "dependencies": ["react", "tailwindcss"],
+ "props": [
+ {
+ "name": "open",
+ "type": "boolean",
+ "required": true,
+ "description": "Controls the visibility of the modal"
+ },
+ {
+ "name": "onClose",
+ "type": "() => void",
+ "required": true,
+ "description": "Callback function triggered when the modal should close"
+ },
+ {
+ "name": "children",
+ "type": "React.ReactNode",
+ "required": true,
+ "description": "Modal content - typically Modal.Header, Modal.Body, and Modal.Footer components"
+ },
+ {
+ "name": "size",
+ "type": "'sm' | 'md' | 'lg' | 'xl' | 'full'",
+ "required": false,
+ "default": "md",
+ "description": "Sets the maximum width of the modal"
+ },
+ {
+ "name": "closeOnOverlay",
+ "type": "boolean",
+ "required": false,
+ "default": true,
+ "description": "Whether clicking the overlay/backdrop closes the modal"
+ },
+ {
+ "name": "closeOnEsc",
+ "type": "boolean",
+ "required": false,
+ "default": true,
+ "description": "Whether pressing the ESC key closes the modal"
+ },
+ {
+ "name": "showCloseButton",
+ "type": "boolean",
+ "required": false,
+ "default": true,
+ "description": "Whether to display the X close button in the top-right corner"
+ }
+ ],
+ "subComponents": [
+ {
+ "name": "Modal.Header",
+ "props": [
+ {
+ "name": "children",
+ "type": "React.ReactNode",
+ "required": true,
+ "description": "Header content - typically the modal title"
+ },
+ {
+ "name": "className",
+ "type": "string",
+ "required": false,
+ "description": "Additional CSS classes to apply to the header"
+ }
+ ]
+ },
+ {
+ "name": "Modal.Body",
+ "props": [
+ {
+ "name": "children",
+ "type": "React.ReactNode",
+ "required": true,
+ "description": "Main modal content"
+ },
+ {
+ "name": "className",
+ "type": "string",
+ "required": false,
+ "description": "Additional CSS classes to apply to the body"
+ }
+ ]
+ },
+ {
+ "name": "Modal.Footer",
+ "props": [
+ {
+ "name": "children",
+ "type": "React.ReactNode",
+ "required": true,
+ "description": "Footer content - typically action buttons"
+ },
+ {
+ "name": "className",
+ "type": "string",
+ "required": false,
+ "description": "Additional CSS classes to apply to the footer"
+ }
+ ]
+ }
+ ]
+}