### Install Vaul Vue with npm Source: https://github.com/unovue/vaul-vue/blob/main/README.md Installs the Vaul Vue package using the npm package manager. This is another standard method for managing project dependencies. ```bash npm install vaul-vue ``` -------------------------------- ### Install Vaul Vue with pnpm Source: https://github.com/unovue/vaul-vue/blob/main/README.md Installs the Vaul Vue package using the pnpm package manager. This is a common way to add dependencies to a Vue project. ```bash pnpm add vaul-vue ``` -------------------------------- ### Install vaul-vue Package Source: https://context7.com/unovue/vaul-vue/llms.txt Instructions for installing the vaul-vue package using npm, pnpm, or yarn. This is the first step before using the component library. ```bash npm install vaul-vue ``` ```bash pnpm add vaul-vue ``` ```bash yarn add vaul-vue ``` -------------------------------- ### Basic Usage of Vaul Vue Drawer Component Source: https://github.com/unovue/vaul-vue/blob/main/README.md Demonstrates the basic setup for using the Vaul Vue drawer component. It shows how to import necessary components and structure the template for a functional drawer. ```vue ``` -------------------------------- ### Install Vaul Vue with yarn Source: https://github.com/unovue/vaul-vue/blob/main/README.md Installs the Vaul Vue package using the yarn package manager. This is a popular alternative for managing dependencies in JavaScript projects. ```bash yarn add vaul-vue ``` -------------------------------- ### Vue: Implement Nested Vaul-Vue Drawers Source: https://context7.com/unovue/vaul-vue/llms.txt This example demonstrates how to create nested drawers using Vaul-Vue. It shows the structure for placing a `DrawerRootNested` inside the content of a parent `DrawerRoot`. Proper z-index management is handled internally by the library. It imports relevant components from 'vaul-vue'. ```vue ``` -------------------------------- ### Vue: Track Drawer Events with Event Handlers Source: https://context7.com/unovue/vaul-vue/llms.txt This example illustrates how to track user interactions with the Vaul-Vue Drawer using various event listeners. It demonstrates how to capture drag percentage, release state, close events, open state changes, and animation end events. It uses `ref` from 'vue' for state management and imports drawer components from 'vaul-vue'. ```vue ``` -------------------------------- ### Vue: Customize Drawer Close Threshold Source: https://context7.com/unovue/vaul-vue/llms.txt This example shows how to customize the drag distance required to close the Vaul-Vue Drawer. By default, this is 25% of the drawer's height. This example sets it to 50% using the `close-threshold` prop on `DrawerRoot`. It imports necessary components from 'vaul-vue'. ```vue ``` -------------------------------- ### Vaul-Vue Non-Dismissible Drawer for Required Actions Source: https://context7.com/unovue/vaul-vue/llms.txt This Vue.js example shows how to create a non-dismissible drawer using `vaul-vue`. The drawer is controlled by a `v-model:open` binding and cannot be closed by dragging or clicking the overlay. It's designed for scenarios where a user must complete a specific action before the drawer can be closed, using the `dismissible` and `modal` props. ```vue ``` -------------------------------- ### Vue: Restrict Drawer Dragging to Handle Source: https://context7.com/unovue/vaul-vue/llms.txt This example shows how to configure the Vaul-Vue Drawer to only allow dragging via its handle element. This is useful for controlling scrollable content within the drawer. It imports necessary components from 'vaul-vue' and uses the `handle-only` prop on `DrawerRoot`. ```vue ``` -------------------------------- ### Vaul Vue DrawerRoot TypeScript Props Reference Source: https://context7.com/unovue/vaul-vue/llms.txt Provides a comprehensive reference for the `DrawerRootProps` interface in Vaul Vue, detailing all available configuration options for controlling drawer state, behavior, visual effects, and drag interactions. This allows for type-safe and advanced customization of the drawer component. ```typescript import type { DrawerRootProps, DrawerDirection } from 'vaul-vue' // Complete prop interface const drawerConfig: DrawerRootProps = { // State control open: undefined, // v-model:open for controlled state defaultOpen: false, // Initial open state // Snap points snapPoints: [0.2, 0.5, 0.8], // Array of percentages or px strings activeSnapPoint: 0.5, // v-model:active-snap-point fadeFromIndex: 2, // Start overlay fade from this snap index // Behavior dismissible: true, // Allow closing via drag/click outside modal: true, // Block interaction with outside elements closeThreshold: 0.25, // Drag percentage needed to close (0-1) direction: 'bottom', // 'top' | 'bottom' | 'left' | 'right' // Visual effects shouldScaleBackground: true, // Scale background content setBackgroundColorOnScale: true, // Change background color when scaled // Drag behavior handleOnly: false, // Only drag from DrawerHandle component scrollLockTimeout: 500, // Ms before allowing drag after scroll // Advanced nested: false, // Is this a nested drawer fixed: false, // Don't move drawer up when keyboard opens noBodyStyles: false, // Don't apply body styles preventScrollRestoration: false, // Don't restore scroll on close } ``` -------------------------------- ### Basic Drawer Implementation in Vue Source: https://context7.com/unovue/vaul-vue/llms.txt Demonstrates a simple Vaul Vue drawer that opens from the bottom with a trigger button. It utilizes DrawerRoot, DrawerTrigger, DrawerPortal, DrawerOverlay, and DrawerContent components for basic functionality. ```vue ``` -------------------------------- ### Drawer with Pixel-Based Snap Points in Vue Source: https://context7.com/unovue/vaul-vue/llms.txt Illustrates using fixed pixel values mixed with viewport percentages for snap points in Vaul Vue drawers. This allows for precise positioning independent of screen size. ```vue ``` -------------------------------- ### Vaul-Vue Drawers with Directional Opening Source: https://context7.com/unovue/vaul-vue/llms.txt This Vue.js component illustrates how to implement drawers that open from different edges of the screen using `vaul-vue`. It showcases drawers opening from the bottom (default), top, left, and right by setting the `direction` prop on `DrawerRoot`. Each drawer includes a trigger, overlay, and content area, styled appropriately for their direction. ```vue ``` -------------------------------- ### Drawer with Snap Points in Vue Source: https://context7.com/unovue/vaul-vue/llms.txt Implements a multi-position Vaul Vue drawer that snaps to predefined heights (20%, 50%, 100%) using the snapPoints prop and v-model:active-snap-point. Includes a DrawerHandle for interaction. ```vue ``` -------------------------------- ### Vaul-Vue Drawer with Background Scaling and Color Source: https://context7.com/unovue/vaul-vue/llms.txt This Vue.js component demonstrates a drawer that scales down and optionally changes the background color of the main content when opened. It utilizes `vaul-vue` components for drawer functionality. The `should-scale-background` prop controls the scaling effect, and `set-background-color-on-scale` enables background color changes. ```vue ``` -------------------------------- ### Controlled Drawer with State Management in Vue Source: https://context7.com/unovue/vaul-vue/llms.txt Shows how to programmatically control the open/close state of a Vaul Vue drawer using v-model and a reactive reference. Includes a form within the drawer and a close button. ```vue ``` -------------------------------- ### Vue Drawer with Accessibility Features Source: https://context7.com/unovue/vaul-vue/llms.txt Implements an accessible drawer component using Vaul Vue, incorporating ARIA labels and semantic HTML structure for improved user experience and screen reader compatibility. It includes a trigger, overlay, content, title, description, and close button. ```vue ``` -------------------------------- ### Vue Drawer with No-Drag Zones Source: https://context7.com/unovue/vaul-vue/llms.txt Demonstrates how to prevent specific areas within a Vaul Vue drawer from triggering the drag-to-close functionality by using the `data-vaul-no-drag` attribute. This allows for interactive elements within the drawer without unintended drawer movement. ```vue ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.