Drawer

A React drawer and bottom sheet on Base UI with swipe to dismiss, snap points, a grab handle, and five sides including a fullscreen mobile panel.

Loading preview

Examples

Practical examples and common states for the same installable component.

Bottom

Default mobile checkout and action drawer.

examples/drawer-bottom.tsx
import { Drawer, DrawerContent, DrawerTrigger } from "@/components/wensity/drawer";
export function BottomDrawer() {
return (
<Drawer>
<DrawerTrigger>Checkout</DrawerTrigger>
<DrawerContent title="Order summary" />
</Drawer>
);
}

Left

Horizontal slide-in from the left with drag dismiss.

examples/drawer-left.tsx
import { Drawer, DrawerContent, DrawerTrigger } from "@/components/wensity/drawer";
export function LeftDrawer() {
return (
<Drawer side="left">
<DrawerTrigger>Locations</DrawerTrigger>
<DrawerContent title="Nearby" />
</Drawer>
);
}

Right

Cart and billing panels from the right edge.

examples/drawer-right.tsx
import { Drawer, DrawerContent, DrawerTrigger } from "@/components/wensity/drawer";
export function RightDrawer() {
return (
<Drawer side="right">
<DrawerTrigger>Billing</DrawerTrigger>
<DrawerContent title="Payment method" />
</Drawer>
);
}

Snap points

Drag between viewport-height snap points (35%, 65%, full).

examples/drawer-snap-points.tsx
import {
Drawer,
DrawerContent,
DrawerSnapPanel,
DrawerTrigger,
} from "@/components/wensity/drawer";
export function SnapDrawer() {
return (
<Drawer snapPoints={[0.35, 0.65, 1]}>
<DrawerTrigger>Track shipment</DrawerTrigger>
<DrawerContent title="Delivery status">
<DrawerSnapPanel>Step 1 content</DrawerSnapPanel>
<DrawerSnapPanel>Step 2 content</DrawerSnapPanel>
<DrawerSnapPanel>Step 3 content</DrawerSnapPanel>
</DrawerContent>
</Drawer>
);
}

Fullscreen

Immersive full-viewport drawer for share flows.

examples/drawer-fullscreen.tsx
import { Drawer, DrawerContent, DrawerTrigger } from "@/components/wensity/drawer";
export function FullscreenDrawer() {
return (
<Drawer side="fullscreen">
<DrawerTrigger>Share</DrawerTrigger>
<DrawerContent title="Share link" />
</Drawer>
);
}

Overview

Drawer is a React and Tailwind CSS drawer and bottom sheet on Base UI, in Next.js or any React app, that users can swipe away toward its own edge. It opens from any edge or fills the screen, and bottom and top drawers accept snapPoints so a sheet can rest half open. A grab handle hints at the gesture, and the title is always passed to screen readers, even when it is not shown. It covers the Vaul pattern without that extra package, and DrawerScrollBody keeps dragging and scrolling from fighting.

Installation

Run the following command

~/your-project
pnpm dlx wensity@latest add drawer

Usage

Import Drawer from @/components/wensity/drawer and render it anywhere in your React or Next.js app. The source lands in your own repo, so every prop, class and animation below is yours to edit.

app/example.tsx
import { Drawer, DrawerContent, DrawerTrigger } from "@/components/wensity/drawer";
export function DrawerDemo() {
return (
<Drawer>
<DrawerTrigger>Open</DrawerTrigger>
<DrawerContent title="Checkout">...</DrawerContent>
</Drawer>
);
}

Props

PropTypeDefaultDescription
side"bottom" | "top" | "left" | "right" | "fullscreen""bottom"Edge the drawer enters from, and the swipe axis that dismisses it.
openboolean-Controlled open state.
onOpenChange(open: boolean) => void-Called when the drawer opens or closes.
modalbooleantrueTraps focus and blocks interaction with the page behind.
  • Genie Effect component preview

    Genie Effect

    A macOS genie minimize built on a real per-slice warp that sucks any window, folder, or panel down into a waiting dock.

  • Tinder-Style Swipe Cards component preview

    Tinder-Style Swipe Cards

    Tinder-style swipe cards where the top card flicks off under your thumb and the one underneath rises in real time.

  • Gooey Navigation Menu component preview

    Gooey Navigation Menu

    A liquid FAB whose child actions stretch out of the trigger like molten metal.

  • Peel Effect component preview

    Peel Effect

    Grab any corner and peel the sheet back. It curls, catches the light, and springs shut with the weight of paper.