Y2K UI

Drawer

A mobile-first slide-in panel from the bottom, powered by Vaul.

drawer-demo.app

Installation

terminal.sh
npx y2kui add drawer

Usage

import {
  Drawer,
  DrawerTrigger,
  DrawerContent,
  DrawerHeader,
  DrawerTitle,
  DrawerDescription,
} from "@/components/ui/drawer"

<Drawer>
  <DrawerTrigger asChild>
    <Button>Open</Button>
  </DrawerTrigger>
  <DrawerContent>
    <DrawerHeader>
      <DrawerTitle>Title</DrawerTitle>
      <DrawerDescription>Description</DrawerDescription>
    </DrawerHeader>
    <p>Content goes here.</p>
  </DrawerContent>
</Drawer>

Props

PropTypeDefaultDescription
Drawersee Vaul—Root. Accepts open, onOpenChange, snapPoints.
DrawerContentReactNode—Slide-up panel with drag handle.
DrawerTriggerReactNode—Button that opens the drawer.
DrawerHeaderReactNode—Groups title and description.
DrawerFooterReactNode—Action area at the bottom.

On this page