DEVELOPMENT PREVIEWIn development

Drawer

A sliding panel that appears from the edge of the screen.

Examples

Basic Usage

Click the buttons to open drawers from different sides.

Drawer Example
import { useState } from 'react'
import { Button, Drawer } from '@creo-team/buzz-ui/client'

export default function Example() {
	const [open, setOpen] = useState(false)

	return (
		<>
			<Button onClick={() => setOpen(true)}>
				Open Drawer
			</Button>
			
			<Drawer
				open={open}
				onOpenChange={setOpen}
				side="right"
				size="md"
				title="Drawer Title"
				description="This is a drawer description"
			>
				<div className="space-y-4">
					<p>Drawer content goes here.</p>
					<Button onClick={() => setOpen(false)}>
						Close Drawer
					</Button>
				</div>
			</Drawer>
		</>
	)
}

Sizes

Drawers support different sizes: sm, md, lg, xl, and full.

API Reference

PropTypeDefaultDescription
open*
booleanWhether the drawer is open
onOpenChange*
(open: boolean) => voidCallback when open state changes
side
'left' | 'right' | 'top' | 'bottom''right'Which side the drawer slides from
size
'sm' | 'md' | 'lg' | 'xl' | 'full''md'Size of the drawer
title
stringOptional title for the drawer
showCloseButton
booleantrueWhether to show the close button