diff --git a/docs/data/base/components/modal/KeepMountedModal.js b/docs/data/base/components/modal/KeepMountedModal.js
index 546d1e24fc3de8..10027a57d3bffb 100644
--- a/docs/data/base/components/modal/KeepMountedModal.js
+++ b/docs/data/base/components/modal/KeepMountedModal.js
@@ -4,6 +4,33 @@ import clsx from 'clsx';
import { styled, Box } from '@mui/system';
import ModalUnstyled from '@mui/base/ModalUnstyled';
+export default function KeepMountedModal() {
+ const [open, setOpen] = React.useState(false);
+ const handleOpen = () => setOpen(true);
+ const handleClose = () => setOpen(false);
+
+ return (
+
(null);
@@ -60,3 +39,24 @@ export default function ServerModal() {
);
}
+
+const StyledModal = styled(ModalUnstyled)`
+ position: fixed;
+ z-index: 1300;
+ right: 0;
+ bottom: 0;
+ top: 0;
+ left: 0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ padding: 8px;
+ background: inherit;
+`;
+
+const style = {
+ position: 'relative',
+ width: 400,
+ border: '2px solid currentColor',
+ padding: '16px 32px 24px 32px',
+};
diff --git a/docs/data/base/components/modal/SpringModal.js b/docs/data/base/components/modal/SpringModal.js
index f52fa91f991376..7265414faecc29 100644
--- a/docs/data/base/components/modal/SpringModal.js
+++ b/docs/data/base/components/modal/SpringModal.js
@@ -5,6 +5,35 @@ import ModalUnstyled from '@mui/base/ModalUnstyled';
import Button from '@mui/base/ButtonUnstyled';
import { useSpring, animated } from '@react-spring/web';
+export default function SpringModal() {
+ const [open, setOpen] = React.useState(false);
+ const handleOpen = () => setOpen(true);
+ const handleClose = () => setOpen(false);
+
+ return (
+
+
+
+
+
+ Text in a modal
+
+ Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
+
+
+
+
+
+ );
+}
+
const BackdropUnstyled = React.forwardRef((props, ref) => {
const { open, ...other } = props;
return ;
@@ -79,32 +108,3 @@ const style = (theme) => ({
boxShadow: 24,
padding: '16px 32px 24px 32px',
});
-
-export default function SpringModal() {
- const [open, setOpen] = React.useState(false);
- const handleOpen = () => setOpen(true);
- const handleClose = () => setOpen(false);
-
- return (
-
-
-
-
-
- Text in a modal
-
- Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
-
-
-
-
-
- );
-}
diff --git a/docs/data/base/components/modal/SpringModal.tsx b/docs/data/base/components/modal/SpringModal.tsx
index 5d84459dd26e3f..853b423a43abac 100644
--- a/docs/data/base/components/modal/SpringModal.tsx
+++ b/docs/data/base/components/modal/SpringModal.tsx
@@ -4,6 +4,35 @@ import ModalUnstyled from '@mui/base/ModalUnstyled';
import Button from '@mui/base/ButtonUnstyled';
import { useSpring, animated } from '@react-spring/web';
+export default function SpringModal() {
+ const [open, setOpen] = React.useState(false);
+ const handleOpen = () => setOpen(true);
+ const handleClose = () => setOpen(false);
+
+ return (
+
+
+
+
+
+ Text in a modal
+
+ Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
+
+
+
+
+
+ );
+}
+
const BackdropUnstyled = React.forwardRef<
HTMLDivElement,
{ children: React.ReactElement; open: boolean }
@@ -78,32 +107,3 @@ const style = (theme: Theme) => ({
boxShadow: 24,
padding: '16px 32px 24px 32px',
});
-
-export default function SpringModal() {
- const [open, setOpen] = React.useState(false);
- const handleOpen = () => setOpen(true);
- const handleClose = () => setOpen(false);
-
- return (
-
-
-
-
-
- Text in a modal
-
- Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
-
-
-
-
-
- );
-}
diff --git a/docs/data/base/components/modal/TransitionsModal.js b/docs/data/base/components/modal/TransitionsModal.js
index 4d579afa004460..c5893ba3039744 100644
--- a/docs/data/base/components/modal/TransitionsModal.js
+++ b/docs/data/base/components/modal/TransitionsModal.js
@@ -5,6 +5,35 @@ import ModalUnstyled from '@mui/base/ModalUnstyled';
import Fade from '@mui/material/Fade';
import Button from '@mui/base/ButtonUnstyled';
+export default function TransitionsModal() {
+ const [open, setOpen] = React.useState(false);
+ const handleOpen = () => setOpen(true);
+ const handleClose = () => setOpen(false);
+
+ return (
+
+
+
+
+
+ Text in a modal
+
+ Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
+
+
+
+
+
+ );
+}
+
const BackdropUnstyled = React.forwardRef((props, ref) => {
const { open, ...other } = props;
return (
@@ -52,32 +81,3 @@ const style = (theme) => ({
boxShadow: 24,
padding: '16px 32px 24px 32px',
});
-
-export default function TransitionsModal() {
- const [open, setOpen] = React.useState(false);
- const handleOpen = () => setOpen(true);
- const handleClose = () => setOpen(false);
-
- return (
-
-
-
-
-
- Text in a modal
-
- Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
-
-
-
-
-
- );
-}
diff --git a/docs/data/base/components/modal/TransitionsModal.tsx b/docs/data/base/components/modal/TransitionsModal.tsx
index 35b7ab07d2602e..581258ae3d4cc5 100644
--- a/docs/data/base/components/modal/TransitionsModal.tsx
+++ b/docs/data/base/components/modal/TransitionsModal.tsx
@@ -4,6 +4,35 @@ import ModalUnstyled from '@mui/base/ModalUnstyled';
import Fade from '@mui/material/Fade';
import Button from '@mui/base/ButtonUnstyled';
+export default function TransitionsModal() {
+ const [open, setOpen] = React.useState(false);
+ const handleOpen = () => setOpen(true);
+ const handleClose = () => setOpen(false);
+
+ return (
+
+
+
+
+
+ Text in a modal
+
+ Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
+
+
+
+
+
+ );
+}
+
const BackdropUnstyled = React.forwardRef(
(props, ref) => {
const { open, ...other } = props;
@@ -49,32 +78,3 @@ const style = (theme: Theme) => ({
boxShadow: 24,
padding: '16px 32px 24px 32px',
});
-
-export default function TransitionsModal() {
- const [open, setOpen] = React.useState(false);
- const handleOpen = () => setOpen(true);
- const handleClose = () => setOpen(false);
-
- return (
-
-
-
-
-
- Text in a modal
-
- Duis mollis, est non commodo luctus, nisi erat porttitor ligula.
-
-
-
-
-
- );
-}