A headless drawer component that manages modal state, snap points, and swipe gestures for accessible overlay interfaces.
<!--
Source: https://github.com/unovue/reka-ui | License: MIT | Copyright 2023 UnoVue
Provided via justclaw.it.com; keep this notice with the code.
-->
<script lang="ts">
import type { Ref } from 'vue'
import type {
DrawerSnapPoint,
NestedSwipeProgressStore,
SwipeDirection,
} from './utils'
import { createContext, useId } from '@/shared'
export type DrawerModal = boolean | 'trap-focus'
export type DrawerOpenChangeReason
= | 'swipe'
| 'escape-key'
| 'outside-press'
| 'click'
| 'cancel'
| 'trigger-press'
| 'close-press'
export interface DrawerOpenChangeDetails {
reason?: DrawerOpenChangeReason
/** Keeps the drawer in its current state. Call it while handling `update:open`. */
cancel: () => void
/** Whether `cancel()` was called. */
readonly is
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key