A high-fidelity modal overlay component with focus-trapping, backdrop interactions, and Indigo-themed buttons.
Semi-transparent surface that dims the background and captures clicks to close.
Contains the title and close action, with clear separation from the body.
The primary scrollable area for information, forms, or interaction data.
Sticky bottom area for primary and secondary Indigo-themed actions.
// ExperimentModal.tsx
const ExperimentModal = ({ isOpen, onClose, title, children }) => {
if (!isOpen) return null;
return createPortal(
<div className="fixed inset-0 z-50 flex items-center justify-center">
<div className="absolute inset-0 bg-black/40" onClick={onClose} />
<div className="relative bg-white rounded-2xl shadow-2xl w-full max-w-lg">
<header className="p-4 border-b"><h3>{title}</h3></header>
<div className="p-6">{children}</div>
</div>
</div>,
document.body
);
};