Replies: 2 comments
-
I'm also very interested in this use case! |
Beta Was this translation helpful? Give feedback.
0 replies
-
There is already an attempt to do this: https://github.com/redpangilinan/credenza |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey ShadCN-lers 👋 (builders and consumers),
I would like to offer merging the
<Drawer/>
and<Dialog/>
component into an additional standalone "Responsive Modal" component (name tbd).✨ This will make it so much easier building dialog content for mobile! One component instead of stitching two together! ✨
Situation
Currently a "Responsive Dialog" is shown as an example on the ShadCN website to combine a
<Drawer/>
(on mobile) with a<Dialog/>
(on desktop).And this is how modals should work. A
<Drawer/>
will most often be preferred over a<Dialog/>
on mobile.However, at this point, one then needs to copy the example and pass content into both components.
As both
<Drawer/
> and<Dialog/>
follow the builder pattern of<... .Provider/>
,<... .Trigger/>
,<... .Content/>
,<... .Footer/>
etc... it would be very much feasible to bring components of both<Drawer/>
and<Dialog/>
into one unified interface.Use that new
<ResponsiveDialog/>
(imagine a nicer name) component and you'll automatically get different Triggers, Footers, Content, etc... for mobile and for desktop.Would be keen to understand whether this is not just me, but whether it is actually of higher demand!
(And what limitations I might be overseeing for this to work)
Beta Was this translation helpful? Give feedback.
All reactions