Files
react-test/docs/data/joy/components/drawer/DrawerCloseButton.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
649 B
JavaScript
Raw Normal View History

2025-12-12 14:26:25 +09:00
import * as React from 'react';
import Box from '@mui/joy/Box';
import Button from '@mui/joy/Button';
import Drawer from '@mui/joy/Drawer';
import DialogTitle from '@mui/joy/DialogTitle';
import ModalClose from '@mui/joy/ModalClose';
export default function DrawerCloseButton() {
const [open, setOpen] = React.useState(false);
return (
<Box sx={{ display: 'flex' }}>
<Button variant="outlined" color="neutral" onClick={() => setOpen(true)}>
Open drawer
</Button>
<Drawer open={open} onClose={() => setOpen(false)}>
<ModalClose />
<DialogTitle>Title</DialogTitle>
</Drawer>
</Box>
);
}