Y2K UI

Drawer

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

drawer-demo.app

Installation

terminal.sh
npx y2kui@latest 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 VaulRoot. Accepts open, onOpenChange, snapPoints.
DrawerContentReactNodeSlide-up panel with drag handle.
DrawerTriggerReactNodeButton that opens the drawer.
DrawerHeaderReactNodeGroups title and description.
DrawerFooterReactNodeAction area at the bottom.

On this page