Skip to main content
v1.1.2 • Unstyled React Drawer Primitive

Unstyled, accessible, and performant drawer for React.

Designed as a flexible modal and sheet pattern for desktop, tablet, and mobile interfaces. Built with touch gesture physics and ARIA dialog compliance.

ExampleDrawer.tsx
import { Drawer } from '@ughur/temper';

export function ExampleDrawer() {
return (
<Drawer.Root shouldScaleBackground>
<Drawer.Trigger className="px-4 py-2 bg-black text-white rounded-md font-medium">
Open Drawer
</Drawer.Trigger>

<Drawer.Portal>
<Drawer.Overlay className="fixed inset-0 bg-black/40" />
<Drawer.Content className="fixed bottom-0 left-0 right-0 bg-white p-6 rounded-t-2xl max-h-[90vh]">
<Drawer.Handle className="w-12 h-1.5 bg-gray-300 rounded-full mx-auto mb-6" />
<Drawer.Title className="text-lg font-bold">
Temper Drawer
</Drawer.Title>
<Drawer.Description className="text-gray-600 mb-6">
An unstyled, accessible drawer primitive powered by Radix UI.
</Drawer.Description>
<Drawer.Close className="px-4 py-2 bg-gray-100 rounded-md">
Close
</Drawer.Close>
</Drawer.Content>
</Drawer.Portal>
</Drawer.Root>
);
}

Physics & Touch Gestures

Built with drag tracking, velocity-based snapping, and spring physics interactions.

Accessible Primitive

Powered by Radix UI with focus trapping, screen reader guidance, and Esc-key handling.

Flexible Snap Points

Supports percentage and pixel snap heights, custom index thresholds, and sequential point snapping.

Multi-Directional

Slide in from bottom, top, left, or right with native touch gesture feeling.

100% Unstyled

Complete freedom to design with Tailwind CSS, CSS Modules, styled-components, or plain CSS.

Background Scaling

Effortlessly scale application content to achieve native iOS modal presentation effects.