mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
Signed-off-by: The1111mp <The1111mp@outlook.com> Co-authored-by: The1111mp <The1111mp@outlook.com>
64 lines
1.7 KiB
TypeScript
64 lines
1.7 KiB
TypeScript
const App = `import {Drawer, DrawerContent, DrawerHeader, DrawerBody, DrawerFooter, Button, useDisclosure} from "@nextui-org/react";
|
|
|
|
export default function App() {
|
|
const {isOpen, onOpen, onOpenChange} = useDisclosure();
|
|
|
|
return (
|
|
<>
|
|
<Button onPress={onOpen}>Open Drawer</Button>
|
|
<Drawer
|
|
isOpen={isOpen}
|
|
onOpenChange={onOpenChange}
|
|
motionProps={{
|
|
variants: {
|
|
enter: {
|
|
opacity: 1,
|
|
x: 0,
|
|
duration: 0.3,
|
|
},
|
|
exit: {
|
|
x: 100,
|
|
opacity: 0,
|
|
duration: 0.3,
|
|
},
|
|
},
|
|
}}
|
|
>
|
|
<DrawerContent>
|
|
{(onClose) => (
|
|
<>
|
|
<DrawerHeader className="flex flex-col gap-1">Custom Motion Drawer</DrawerHeader>
|
|
<DrawerBody>
|
|
<p>
|
|
This drawer has custom enter/exit animations.
|
|
</p>
|
|
<p>
|
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
Nullam pulvinar risus non risus hendrerit venenatis.
|
|
Pellentesque sit amet hendrerit risus, sed porttitor quam.
|
|
</p>
|
|
</DrawerBody>
|
|
<DrawerFooter>
|
|
<Button color="danger" variant="light" onPress={onClose}>
|
|
Close
|
|
</Button>
|
|
<Button color="primary" onPress={onClose}>
|
|
Action
|
|
</Button>
|
|
</DrawerFooter>
|
|
</>
|
|
)}
|
|
</DrawerContent>
|
|
</Drawer>
|
|
</>
|
|
);
|
|
}`;
|
|
|
|
const react = {
|
|
"/App.jsx": App,
|
|
};
|
|
|
|
export default {
|
|
...react,
|
|
};
|