Vaul

Details about Vaul

▶️ Key Features
  • Free, open-source React drawer component

  • Built with React, Radix UI, and TypeScript

  • Features customizable, accessible drawer for mobile and tablet

  • Supports snap points, background scaling, and multi-directional drawers

  • MIT-licensed

#What is Vaul?

Vaul is a free, open-source, unstyled drawer component for React, developed by Emil Kowalski, designed to replace dialogs on mobile and tablet devices. Its primary goal is to provide a lightweight, accessible, and customizable drawer for modern web applications, targeting React developers building responsive interfaces like settings panels, side menus, or modals. Built with React, Radix UI Dialog, and TypeScript, Vaul offers snap points, background scaling, and support for top, bottom, left, or right drawers. It emphasizes developer control with unstyled components and a robust API, making it ideal for seamless integration into Next.js or React projects. For accessible UI enthusiasts, Vaul is a perfect fit, delivering a versatile drawer with WAI-ARIA compliance and active community support.

#Features ⚡️

  • Drawer Component: Unstyled drawer as a dialog alternative for mobile/tablet.

  • Snap Points: Customizable heights/widths for partial drawer states (e.g., 0.5, 0.8).

  • Multi-Directional: Supports top, bottom, left, or right drawer positions.

  • Background Scaling: Optional scaling effect with customizable body styles.

  • Accessibility: WAI-ARIA-compliant via Radix UI with keyboard navigation.

  • Modal/Non-Modal: Toggle modal behavior with overlay and scroll locking.

  • Container Support: Parent container sizing for nested layouts.

  • Touch Optimized: Handles iOS touch events and long-press issues.

#Pros and Cons

#✅ Pros

  • Highly Customizable: Unstyled design allows full styling control with Tailwind or CSS.

  • Accessible: Radix UI ensures WAI-ARIA compliance and keyboard support.

  • Lightweight: 184 kB npm package with minimal dependencies (Radix UI Dialog).

  • Active Maintenance: Regular updates (v1.1.2, December 2024) and 7.4k GitHub stars.

  • Community Adoption: Used by Vercel in production and ported to Svelte/Vue.

  • Robust API: Supports snap points, controlled state, and nested drawers.

  • Type-Safe: TypeScript ensures error-free development.

#⚠️ Cons

  • React-Only: Limited to React; non-React users seek alternatives.

  • Learning Curve: Requires Radix UI and snap point configuration knowledge.

  • Accessibility Bugs: Minor keyboard navigation issues reported (e.g., aria-hidden errors).

  • Background Scaling Issues: Black background flashes in some setups (e.g., Storybook).

  • Documentation Gaps: Could expand on advanced use cases like nested drawers.

  • iOS Edge Cases: Touch event handling needed workarounds for scrolling.

  • No Provider API: Lacks MUI-like provider for modal interactions.

#Included Components - Templates

Vaul provides a variety of drawer-related components:

  • Drawer.Root: Core wrapper for controlled/uncontrolled drawer state.

  • Drawer.Trigger: Button or element to open the drawer.

  • Drawer.Content: Container for drawer content with drag support.

  • Drawer.Overlay: Optional overlay for modal behavior and dismissal.

  • Drawer.Portal: Portals content to the body for stacking context.

  • Drawer.Handle: Accessible drag handle for touch devices.

#Pricing 💵

Vaul operates on a Free model:

  • Free Access: Fully open-source under MIT license, available via npm or GitHub.

  • No Pro Version: No premium features or paid tiers mentioned.

#Integrations 🧰

Vaul integrates with:

  • React: Core framework for component functionality.

  • Radix UI Dialog: Accessibility and dialog primitives (@radix-ui/react-dialog).

  • TypeScript: Static typing for robust development.

  • Next.js (Implied): Compatible with Next.js projects, used at Vercel.

  • Tailwind CSS (Optional): Commonly styled with Tailwind for demos.

  • Vercel (Implied): Likely hosting for docs and production use.

  • Bunchee & Playwright: Build and testing tools for development.

Frequently Asked Questions

What is Vaul, and how does it work with shadcn/ui?

Vaul is a free React drawer component, distinct from shadcn/ui but shareable in React ecosystems for accessible, mobile-friendly drawers.

Is Vaul free to use?

Yes, fully open-source under MIT license via npm or GitHub.

Can I use Vaul with other frameworks?

No, React-only, but ports exist for Svelte (vaul-svelte) and Vue (vaul-vue).

Does Vaul support accessibility?

Yes, via Radix UI’s WAI-ARIA compliance, though minor keyboard issues persist.

Vaul

Free

Unstyled drawer component for React that can be used as a Dialog.

Resource Types:
UI Kits :
Shadcn UI
Technology Stack :

Have a product?

Submit your Shadcn product to AllShadcn, get featured, and drive genuine traffic while showcasing your work to the world. Turn your creativity into revenue and begin selling today! 🚀

Submit Product