Repository navigation
[drawer] Create new Drawer / Sheet component - #3680
Conversation
commit: |
Bundle size report
Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
8e7cd0d to
38aae58
Compare
|
any idea when this will ship? I need a drawer component fairly soon but I can always use vaul in the meantime |
|
@piehouserat probably in v1.2.0 release around mid-February |
|
A neat feature would be to use a CloseWatcher to allow closing the drawer with the Android 'back' swipe gesture. This can make drawers and modals feel much more native. The browser support is Chromium only at the moment (I think?) but I usually feature detect it and fall back to an |
7f95c7b to
534f9c0
Compare
There was a problem hiding this comment.
@atomiks Really cool!
I don't know if you already need feedback, maybe not, but since I'm the only one? on Android, I thought I could have a quick play on my phone, and compare with Material UI:
- It's impossible to close the drawer, starting outside of the Popup:
VID_20260117_152111.mp4
Vaul has the same problem. But on Android, all the native apps, e.g., Google Drive supports it. It works "correctly" with Material UI. I'm used to it at this point. The value for end-users is not having to put any mental energy in think where to place your finger to start the dismissal interaction.
- It's possible to extend the drawer to infinity, it shouldn't:
VID_20260117_151449.mp4
I guess it's an Android-only issue, that we are good on iOS, we only have this issue because we want to have resistance when going in the wrong direction, and it's a bit trickier in Android to make it work.
- The close interaction feels too sensitive. I felt I had "cancelled" my interaction, I barely retracted the drawer, but still, it closed it:
VID_20260117_182008.mp4
We could have short interactions like this to close the drawer, but then it should take into account the velocity of the movement; this is the approach used in Material UI.
Otherwise:
- I created a start of a benchmark page https://www.notion.so/mui-org/core-Drawer-Sheet-2ebcbfe7b66080a68150cdc9e0b0ac20, to help copy the best stuff that is out there.
- In #38, linked to the relevant Shadcn issues: helps us understand a bit what those folks need (the key bugs from Vaul) and help folks find our solution.
|
@oliviertassinari thanks for all those points, very helpful - they should be addressed in the latest update |
115dc22 to
71cca0e
Compare
0ad326c to
09ee4ed
Compare
Greptile OverviewGreptile SummaryThis PR introduces a complete Drawer/Sheet component to Base UI with comprehensive swipe gesture support, snap points, nested drawer handling, and background indent effects. Key implementations:
Architecture:
Confidence Score: 5/5
Important Files Changed
|
|
The Drawer's contents are unusable with a stylus. Dragging works, but anything that requires clicks (buttons, inputs) don't work unless a really precise tap is performed (with no movement) |
There was a problem hiding this comment.
Once the drawer is expanded, I can't make it compact again - it always closes when swiped down.
There was a problem hiding this comment.
It's velocity-based, so if you do it slowly enough it won't skip the snap point. The snapToSequentialPoints prop disables this, if necessary
|
When the Drawer content overflows, it's not possible to close it by swiping anymore (using touch, the other pointer types work ok) |
|
The new swipe reason is emitted by Drawer, but ReasonToEventMap has no swipe entry. That widens eventDetails.event to Event for swipe cases, losing pointer/touch typing for consumers handling onOpenChange. |
|
Right-clicking during dragging leaves the drawer in a weird state where it's draggable without a pressed mouse button. |
Can you elaborate on this? It's intentional that scrolling is allowed (and swiping doesn't work) unless |
|
Here's the issue: Screen.Recording.2026-02-10.at.13.01.05.mov |
|
Sometimes when I swipe to open, the drawer doesn't open fully: Screen.Recording.2026-02-11.at.14.09.10.mov |
|
@atomiks Do you think we need anything new to handle multiple panels in a single drawer? Or would it just be that the drawer itself is transparent, and you add your own divs and buttons inside to achieve the effect?
|
Yep, I would say this is the same as this pattern for Dialog: https://base-ui.com/react/components/dialog#placing-elements-outside-the-popup (popup is transparent, inner elements are colored) |
|
@atomiks An example might be useful, if you have time |
|
Been following this for sometime, just wanted to point out that the drawer does not close if you try to flick to close inside a scrollable container. On examples: ios 26 safari and chrome |
|
@green-mint thanks, swipe behavior changed after addressing the recent reviews, this is fixed with regression tests in place |
michaldudak
left a comment
There was a problem hiding this comment.
I'm seeing the behavior I reported in #3680 (comment) in other demos as well (mobile navigation, indent), but we can fix it after the preview version is released. I haven't found other issues.
|
@atomiks When I drag a bottom drawer to very close to the bottom of the viewport, then stop dragging completely, then release, it closes. On Instagram iOS, it seems to work like this too. On Instagram, it requires at least some velocity in order to close (although I think Instagram use RN?) |
|
Just to be clear, this is not getting to be released today? If it's, let's hold a bit on the decision about the plan. (Or maybe it's simply about renaming |

Closes #38
Preview: https://deploy-preview-3680--base-ui.netlify.app/react/components/drawer