Skip to content
h v3.13.3
Search the docs
Find a component, section or page.

Drawer

A panel that slides in and can be dragged shut, on vaul-svelte. From the bottom on a phone, from the side on a desk.

Installation

pnpm add @heyramzi/ui

Usage

import * as Drawer from "@heyramzi/ui/shadcn/drawer";
<Drawer.Root direction="bottom">
  <Drawer.Trigger>Snooze</Drawer.Trigger>
  <Drawer.Content>
    <Drawer.Header>
      <Drawer.Title>Snooze until</Drawer.Title>
      <Drawer.Description>The thread comes back then.</Drawer.Description>
    </Drawer.Header>
    <Drawer.Footer>
      <Drawer.Close>Cancel</Drawer.Close>
    </Drawer.Footer>
  </Drawer.Content>
</Drawer.Root>

API reference

Drawer.Content

portalProps WithoutChildrenOrChild<ComponentProps<typeof DrawerPortal>>
ref bindable HTMLElement | null
Default null
class string
children Snippet
...rest
Every prop of Drawer.Content from vaul-svelte
Prop Type Default
portalProps WithoutChildrenOrChild<ComponentProps<typeof DrawerPortal>>
ref bindable HTMLElement | null null
class string
children Snippet
...rest Every prop of Drawer.Content from vaul-svelte

Drawer.Root

shouldScaleBackground boolean
Default true
open bindable boolean
Default false
activeSnapPoint bindable Drawer.Root
Default null
...rest
Every prop of Drawer.Root from vaul-svelte
Prop Type Default
shouldScaleBackground boolean true
open bindable boolean false
activeSnapPoint bindable Drawer.Root null
...rest Every prop of Drawer.Root from vaul-svelte

Drawer.Trigger

ref bindable HTMLElement | null
Default null
...rest
Every prop of Drawer.Trigger from vaul-svelte
Prop Type Default
ref bindable HTMLElement | null null
...rest Every prop of Drawer.Trigger from vaul-svelte

Drawer.Header

ref bindable HTMLDivElement | null
Default null
class string
children Snippet
...rest
Every prop of HTMLAttributes<HTMLDivElement> from svelte/elements
Prop Type Default
ref bindable HTMLDivElement | null null
class string
children Snippet
...rest Every prop of HTMLAttributes<HTMLDivElement> from svelte/elements

Drawer.Title

ref bindable HTMLElement | null
Default null
class string
...rest
Every prop of Drawer.Title from vaul-svelte
Prop Type Default
ref bindable HTMLElement | null null
class string
...rest Every prop of Drawer.Title from vaul-svelte

Drawer.Description

ref bindable HTMLElement | null
Default null
class string
...rest
Every prop of Drawer.Description from vaul-svelte
Prop Type Default
ref bindable HTMLElement | null null
class string
...rest Every prop of Drawer.Description from vaul-svelte
ref bindable HTMLDivElement | null
Default null
class string
children Snippet
...rest
Every prop of HTMLAttributes<HTMLDivElement> from svelte/elements
Prop Type Default
ref bindable HTMLDivElement | null null
class string
children Snippet
...rest Every prop of HTMLAttributes<HTMLDivElement> from svelte/elements

Drawer.Close

ref bindable HTMLElement | null
Default null
...rest
Every prop of Drawer.Close from vaul-svelte
Prop Type Default
ref bindable HTMLElement | null null
...rest Every prop of Drawer.Close from vaul-svelte

Drawer.NestedRoot

shouldScaleBackground boolean
Default true
open bindable boolean
Default false
activeSnapPoint bindable Drawer.Root
Default null
...rest
Every prop of Drawer.Root from vaul-svelte
Prop Type Default
shouldScaleBackground boolean true
open bindable boolean false
activeSnapPoint bindable Drawer.Root null
...rest Every prop of Drawer.Root from vaul-svelte

Drawer.Overlay

ref bindable HTMLElement | null
Default null
class string
...rest
Every prop of Drawer.Overlay from vaul-svelte
Prop Type Default
ref bindable HTMLElement | null null
class string
...rest Every prop of Drawer.Overlay from vaul-svelte

Drawer.Portal

...rest
Every prop of Drawer.Portal from vaul-svelte
Prop Type Default
...rest Every prop of Drawer.Portal from vaul-svelte