Conversation
Replaces the unmaintained vaul dependency with Base UI's Dialog primitive, keeping the same shadcn-derived public API. Adds Base UI, drops vaul, and switches consumers/stories to the render prop.
Contributor
Author
|
Meh, Radix can do this just fine, we're writing our own Vaul here but atleast we own it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the unmaintained
vauldependency with a sharedDrawerprimitive built on Base UI'sDialog, then migrates the Create TemplateBuildLogsDraweronto it. This is an alternative to #27798 that answers the review question about whether Base UI can cover this one drawer use case.What changed
@base-ui-components/reactand dropsvaul.site/src/components/Drawer/Drawer.tsxkeeps the shadcn-derived public API (Drawer,DrawerTrigger,DrawerClose,DrawerContent,DrawerHeader,DrawerFooter,DrawerTitle,DrawerDescription) but is implemented on Base UI'sDialogparts.direction(top|bottom|left|right) is preserved via context, with slide/fade animations driven bytailwindcss-animateoff Base UI'sdata-open/data-closedattributes.BuildLogsDrawerkeeps the 800px desktop panel andmin(800px, 100%)mobile clamp.playfunctions, covering the controlled close callback.Notes for reviewers
renderprop rather than Radix/Vaul'sasChild, soDrawerClose/DrawerTriggerconsumers userender={<Button .../>}.Dialogis modal by default (focus trap + scroll lock) and closes on outside click / Escape, matching the previous behavior.Decision log
Dialogprovides the portal, backdrop, focus management, and controlled open state a drawer needs. Layering slide-in styling on top keeps the same footprint shadcn's drawer had, without a maintenance-orphaned dependency.BuildLogsDrawerand any future consumers, aside from theasChild->rendercomposition change that Base UI mandates.tailwindcss-animate(already in the repo) and mapped shadcn'sdata-[state=open|closed]selectors onto Base UI'sdata-open/data-closed, so the visual behavior is unchanged.data-drawer-directionattribute on the popup, replacing Vaul's automaticdata-vaul-drawer-direction.tsc, Biome, and the Drawer + BuildLogsDrawer Storybook interaction tests all pass locally.Related: #27798 · DEVEX-251