[Feature Request] A Drawer Component for NextUI #984
Replies: 18 comments 6 replies
-
A temporary alternative would be to use modal component with full-screen prop with inline css and media queries to setup max width to something like 30vw-70vw on different devices |
Beta Was this translation helpful? Give feedback.
-
@gajendr4 Yeah, that's a straightforward option. But still, it would be great if we had such a component. |
Beta Was this translation helpful? Give feedback.
-
If anyone is looking for an example implementation where the modal is being used as a drawer, here's an implementation I put together that may work for you:
Usage:
|
Beta Was this translation helpful? Give feedback.
-
Hey @maxtondelaney! That looks cool and robust since we don't have any drawer components! Looking forward to explore more. Thanks for the example |
Beta Was this translation helpful? Give feedback.
-
Are there any updates regarding this? This would be especially useful as the move to v2.0 has been completed. A great example of a drawer implementation is the one in chakra UI: https://chakra-ui.com/docs/components/drawer/usage |
Beta Was this translation helpful? Give feedback.
-
It's almost been a year. how long until we get our native drawer |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
Update of the workaround of @maxtondelaney with v2
Usage:
|
Beta Was this translation helpful? Give feedback.
-
Here's Custom Drawer using Next Modal Component import React from "react";
import { Input, Modal, ModalContent, ModalHeader, ModalBody, ModalFooter, Button, useDisclosure } from "@nextui-org/react";
interface Props extends React.HTMLProps<HTMLDivElement> {
isOpen: boolean;
onOpenChange: (open: boolean) => void;
}
const CustomDrawer: React.FC<Props> = ({ ...props }) => {
return (
<Modal
scrollBehavior="inside"
isOpen={props.isOpen}
onOpenChange={props.onOpenChange}
placement="center"
backdrop="opaque"
size="full"
classNames={{
wrapper: "flex justify-end",
}}
motionProps={{
variants: {
enter: {
x: 0,
opacity: 1,
transition: {
duration: 0.3,
ease: "easeOut",
},
},
exit: {
x: 50,
opacity: 0,
transition: {
duration: 0.2,
ease: "easeIn",
},
},
}
}}
className="rounded-md max-w-sm w-full h-screen max-h-screen">
<ModalContent>{(onClose) => <>{props.children}</>}</ModalContent>
</Modal>
);
};
export default CustomDrawer; |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
We need a native Drawer plz |
Beta Was this translation helpful? Give feedback.
-
We need a native Drawer plz |
Beta Was this translation helpful? Give feedback.
-
We need a native Drawer plz |
Beta Was this translation helpful? Give feedback.
-
no need for you guys to comment.... they will never add new components. they should listed more the public in my opinion... but it's ok |
Beta Was this translation helpful? Give feedback.
-
Radix-ui primitives uses a prop |
Beta Was this translation helpful? Give feedback.
-
UPD: Scheduled in v2.5.0 (tentatively). |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
I've been using NextUI in one of my side projects lately. I appreciate the simple and robust approach it offers, and I adore the UI overall. However, I am surprised it doesn't have a Drawer component! Although, I implemented it using a third-party library. But it's not enough. Third-party components lack native NextUI effects and support. It's also not the best approach, I guess.
NextUI should also have a Drawer like other UI libraries, e.g., Material UI, Ant Design, Mantine, etc.
Describe the solution you'd like
It'd be great to have a native Drawer component for NextUI. It'll save a lot of tedious jobs and broken tests.
As the Hacktoberfest has begun, it brings a fantastic opportunity to address this lacking feature and implement it right now.
I'd like to suggest that you guys should open an issue for this to implement that. I was also tinkering with the NextUI repo myself.
I'd love to work on that feature and contribute.
Describe alternatives you've considered
I'm temporarily using React Modern Drawer. It's minimal and easy to customize.
Screenshots or Videos
No response
Beta Was this translation helpful? Give feedback.
All reactions