"use client";
import { Drawer } from "@pixxl-tools/components";| Prop | Type | Default | Description |
|---|---|---|---|
side | DrawerSide | end | Edge it slides from; start/end follow the writing direction (default end). |
title | ReactNode | — | Title (any content). |
trigger | ReactElement | — | Element that toggles it (gets aria-expanded/aria-controls). |
backdropProps | HTMLAttributes<HTMLDivElement> | — | Props for the backdrop behind the panel (className, style, …). |
closeLabel | string | from the message catalog | Accessible name of the close button (default from the message catalog). |
container | Element | DocumentFragment | null | document.body | Portal container (default document.body). |
defaultOpen | boolean | — | Initial open state when uncontrolled. |
description | ReactNode | — | Supporting text. |
finalFocus | RefObject<HTMLElement | null> | the trigger, or the previously focused element | Element focused when the overlay closes (default: the trigger, or the previously focused element). |
footer | ReactNode | — | Footer slot. |
sidedefault endDrawerSide
Edge it slides from; start/end follow the writing direction (default end).
titleReactNode
Title (any content).
triggerReactElement
Element that toggles it (gets aria-expanded/aria-controls).
backdropPropsHTMLAttributes<HTMLDivElement>
Props for the backdrop behind the panel (className, style, …).
closeLabeldefault from the message catalogstring
Accessible name of the close button (default from the message catalog).
containerdefault document.bodyElement | DocumentFragment | null
Portal container (default document.body).
defaultOpenboolean
Initial open state when uncontrolled.
descriptionReactNode
Supporting text.
finalFocusdefault the trigger, or the previously focused elementRefObject<HTMLElement | null>
Element focused when the overlay closes (default: the trigger, or the previously focused element).
footerReactNode
Footer slot.
Other props are passed to the root element (HTMLAttributes<HTMLElement>), including className, style, id and aria-* attributes.
<Drawer side="end" title="Inspector" trigger={<Button>Open drawer</Button>}>…</Drawer>