Introducing PrimeReact v11-alpha 🎉Discover Now
styledOverlay

Drawer

Drawer is a panel component displayed as an overlay at the edges of the screen.

preview

Usage#

import { Drawer } from '@primereact/ui/drawer';
<Drawer.Root>
    <Drawer.Trigger />
    <Drawer.Portal>
        <Drawer.Backdrop />
        <Drawer.Popup>
            <Drawer.Header>
                <Drawer.Title />
                <Drawer.Close />
            </Drawer.Header>
            <Drawer.Content />
            <Drawer.Footer />
        </Drawer.Popup>
    </Drawer.Portal>
</Drawer.Root>

Examples#

Basic#

A slide-in panel from the edge of the screen for contextual content.

basic-demo

Position#

The position of the drawer can be customized with the position property. The available values are left, right, top and bottom.

position-demo

Full Screen#

The full screen mode is enabled when position property is set as full.

full-screen-demo

Responsive#

The responsive mode can be enabled by adding className or style to the Drawer.Popup component.

responsive-demo

API#

Sub-Components#

See Primitive API for DrawerRoot, DrawerTrigger, DrawerPortal, DrawerBackdrop, DrawerPopup, DrawerHeader, DrawerTitle, DrawerClose, DrawerContent, DrawerFooter component documentation.

Hooks#

See Headless API for useDrawer hook documentation.

Accessibility#

See Drawer Primitive for WAI-ARIA compliance details and keyboard support.