Skip to content
Browse library
BIU UI/Components/Drawer
COMPONENTS

Drawer

Explore the Drawer component and try its interactive examples.

INTERACTIVE PREVIEW

Preview

Loading preview…
GET STARTED

Installation

Install the component source via shadcn Registry, the BIU CLI, or as an npm package.

TERMINAL / pnpm
pnpm dlx shadcn add @biudev/drawer

First time using @biudev? Map "@biudev": "https://ui.biu.dev/r/0.1.0/{name}.json" under registries in your components.json (see setup).

Usage

Start with this example, then adjust the import path for your project.

EXAMPLE / TSX
"use client";
import { useState } from "react";
import { Drawer } from "@/components/ui/biu/drawer";

export function Example() {
  const [open, setOpen] = useState(false);
  return (
    <>
      <button type="button" onClick={() => setOpen(true)}>
        Open drawer
      </button>
      <Drawer
        open={open}
        onOpenChange={setOpen}
        title="Account details"
        description="Inspect customer metadata."
      >
        <p>Monthly MRR: $2,400</p>
      </Drawer>
    </>
  );
}

Examples

Try each example or switch to its code.

API reference

Properties and defaults from the component source. An asterisk marks a required property; a dash means no explicit default.

DrawerSide

Also accepts properties from 'right' & 'left' & 'bottom' & 'top'.

Some properties depend on the variant; consult the source for the full union.

DrawerSize

Also accepts properties from 'sm' & 'md' & 'lg' & 'full'.

Some properties depend on the variant; consult the source for the full union.

DrawerVariant

Also accepts properties from 'flush' & 'floating'.

Some properties depend on the variant; consult the source for the full union.

DrawerProps

SheetProps

Also accepts properties from DrawerProps.

Source

Review a formatted version of the component source used by the Registry.