Drawer
Also called bottom sheet, side panel, or slide-over
A panel that slides in from the edge of the screen, usually the bottom on phones or the side on desktop, to show extra content or options.
import { Drawer } from '@base-ui/react/drawer';
const FILTERS = ['Paid', 'Pending', 'Refunded', 'Shipped this week'];
// A strong ease-out: the sheet leaves fast and settles softly.
const SLIDE = 'duration-400 ease-[cubic-bezier(0.23,1,0.32,1)]';
export function OrderFiltersSheet() {
return (
<Drawer.Root>
<Drawer.Trigger className='rounded-lg border px-4 py-2 text-sm font-medium hover:bg-muted'>
Filters
</Drawer.Trigger>
<Drawer.Portal>
<Drawer.Backdrop
className={`fixed inset-0 bg-black/40 opacity-[calc(1-var(--drawer-swipe-progress))] transition-opacity ${SLIDE} data-ending-style:opacity-0 data-starting-style:opacity-0 data-swiping:duration-0`}
/>
<Drawer.Viewport className='fixed inset-0 flex items-end justify-center'>
{/* Base UI follows the drag: past its distance or speed threshold
the sheet closes, otherwise it springs back into place. */}
<Drawer.Popup
className={`w-full max-w-lg translate-y-(--drawer-swipe-movement-y) rounded-t-2xl border-t bg-background px-6 pt-3 pb-8 outline-none transition-transform ${SLIDE} data-ending-style:translate-y-full data-starting-style:translate-y-full data-swiping:duration-0 motion-reduce:transition-none`}
>
<div className='mx-auto mb-4 h-1.5 w-10 rounded-full bg-muted' />
<Drawer.Content>
<Drawer.Title className='text-base font-semibold'>
Filter orders
</Drawer.Title>
<div className='mt-4 flex flex-col gap-3'>
{FILTERS.map((filter) => (
<label
key={filter}
className='flex items-center gap-3 text-sm'
>
<input type='checkbox' className='size-4 accent-blue-600' />
{filter}
</label>
))}
</div>
<Drawer.Close className='mt-6 h-11 w-full rounded-lg bg-primary text-sm font-medium text-primary-foreground'>
Show results
</Drawer.Close>
</Drawer.Content>
</Drawer.Popup>
</Drawer.Viewport>
</Drawer.Portal>
</Drawer.Root>
);
}Show the order filters in a bottom sheet on mobile: slide it up over 400ms with cubic-bezier(0.23, 1, 0.32, 1), dim the page behind it, and add a grab handle. Close it when it is dragged down more than 60px or flicked faster than 400px/s, and snap it back otherwise. On screens wider than 768px, slide the same panel in from the right as a 380px side panel. Close it on Escape or a backdrop tap.
Paste into Layerwise or any AI coding tool.
What is Drawer?
A drawer slides in from one edge and covers part of the page, so people keep a sense of where they are. On phones it usually rises from the bottom as a sheet with a small grab handle, and you can drag it down to close it. On larger screens it often slides in from the right as a full-height panel.
Use a drawer for content that is bigger than a popover but still belongs to the current page: filters, a shopping cart, the details of a row, or navigation on mobile. When people only need to make one quick decision, a modal is simpler.
Make it feel physical. Slide it in with a strong ease-out over about 300 to 450ms, fade the backdrop with it, and close it when a drag passes a threshold or ends in a quick flick. Like a modal, it should keep focus inside while open, close on Escape, and fade instead of sliding for people who prefer reduced motion.
Often confused with
Related terms
All termsModal
A window that opens over the page, dims everything behind it, and blocks the rest of the interface until you finish or dismiss it.
Drag gesture
Moving an element by pressing on it and sliding the pointer or finger, usually within set bounds and with a glide after release.
Swipe to dismiss
A gesture where you drag an item sideways past a threshold to remove it, while a shorter swipe lets it spring back into place.
Sidebar
A vertical panel along the side of an app that holds the main navigation, often collapsible to a slim strip of icons.
Build it with Layerwise
Describe your app, watch it run in a live preview, and publish it with a database, storage, and sign-in built in.



