Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

Drawer

A side panel for editing details without leaving context.

Preview

Live preview

Changes apply to this preview only.

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Left navigation drawer

A compact drawer from the left, with real links and an explicit close action.

Open preview

Bottom sheet

A short height for a task that benefits from the full width.

Open preview

Controlled

Side left, size sm, with the open state owned by the page.

Open preview

Usage

Keep essential fields and actions reachable when the viewport is short or narrow.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluDrawerProps

Type source
PimoluDrawerProps public API
NameTypeDefaultDescription
childrenRequiredReactNode—Trigger, content, header, footer and close controls.
openboolean | undefined—Controlled open state. Omit to let the component own it.
defaultOpenboolean | undefinedfalseInitial open state when uncontrolled. Defaults to false.
onOpenChange((open: boolean) => void) | undefined—Called whenever the component asks to open or close.
childrenRequired

ReactNode

No default extracted.

Trigger, content, header, footer and close controls.

open

boolean | undefined

No default extracted.

Controlled open state. Omit to let the component own it.

defaultOpen

boolean | undefined

Default: false

Initial open state when uncontrolled. Defaults to false.

onOpenChange

((open: boolean) => void) | undefined

No default extracted.

Called whenever the component asks to open or close.

PimoluDrawerTriggerProps

Type source
PimoluDrawerTriggerProps public API
NameTypeDefaultDescription
childrenRequiredReactElement<unknown, string | JSXElementConstructor<any>>—The element that opens the drawer: any element, or a component that passes down the props it receives. It gets the ARIA state, the click handler and the ref, and the handlers it already had keep working.
childrenRequired

ReactElement<unknown, string | JSXElementConstructor<any>>

No default extracted.

The element that opens the drawer: any element, or a component that passes down the props it receives. It gets the ARIA state, the click handler and the ref, and the handlers it already had keep working.

PimoluDrawerContentProps

Type source
PimoluDrawerContentProps public API
NameTypeDefaultDescription
childrenReactNode—Header, body and footer of the drawer.
sidePimoluDrawerSide | undefined"right"Edge of the viewport the panel slides from. Defaults to "right".
sizePimoluDrawerSize | undefined"md": a width for left and right drawers, a height for top and bottom drawersPanel size along the side axis. Defaults to "md": a width for left and right drawers, a height for top and bottom drawers.
closeOnOverlayClickboolean | undefinedtrueClose when the overlay is pressed. Defaults to true.
closeOnEscapeboolean | undefinedtrueClose on Escape. Defaults to true.
showCloseButtonboolean | undefinedtrueRender the close button in the panel corner. Defaults to true.
closeLabelstring | undefined"Close"Accessible name of the corner close button. Defaults to "Close".
aria-labelstring | undefined—Accessible name of the panel. Use it only when there is no `DrawerTitle`; a title automatically names the panel.
aria-labelledbystring | undefined—Overrides the id registered by `DrawerTitle`.
aria-describedbystring | undefined—Overrides the id registered by `DrawerDescription`.
classNamestring | undefined—Class applied to the panel.
children

ReactNode

No default extracted.

Header, body and footer of the drawer.

side

PimoluDrawerSide | undefined

Default: "right"

Edge of the viewport the panel slides from. Defaults to "right".

size

PimoluDrawerSize | undefined

Default: "md": a width for left and right drawers, a height for top and bottom drawers

Panel size along the side axis. Defaults to "md": a width for left and right drawers, a height for top and bottom drawers.

closeOnOverlayClick

boolean | undefined

Default: true

Close when the overlay is pressed. Defaults to true.

closeOnEscape

boolean | undefined

Default: true

Close on Escape. Defaults to true.

showCloseButton

boolean | undefined

Default: true

Render the close button in the panel corner. Defaults to true.

closeLabel

string | undefined

Default: "Close"

Accessible name of the corner close button. Defaults to "Close".

aria-label

string | undefined

No default extracted.

Accessible name of the panel. Use it only when there is no `DrawerTitle`; a title automatically names the panel.

aria-labelledby

string | undefined

No default extracted.

Overrides the id registered by `DrawerTitle`.

aria-describedby

string | undefined

No default extracted.

Overrides the id registered by `DrawerDescription`.

className

string | undefined

No default extracted.

Class applied to the panel.

PimoluDrawerHeaderProps

Type source
PimoluDrawerHeaderProps public API
NameTypeDefaultDescription
childrenRequiredReactNode—Public Pimolu prop; see the source declaration for details.
classNamestring | undefined—Public Pimolu prop; see the source declaration for details.
childrenRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

className

string | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

PimoluDrawerTitleProps

Type source
PimoluDrawerTitleProps public API
NameTypeDefaultDescription
childrenRequiredReactNode—Public Pimolu prop; see the source declaration for details.
idstring | undefined—Explicit id, instead of the generated one.
classNamestring | undefined—Public Pimolu prop; see the source declaration for details.
childrenRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

id

string | undefined

No default extracted.

Explicit id, instead of the generated one.

className

string | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

PimoluDrawerDescriptionProps

Type source
PimoluDrawerDescriptionProps public API
NameTypeDefaultDescription
childrenRequiredReactNode—Public Pimolu prop; see the source declaration for details.
idstring | undefined—Explicit id, instead of the generated one.
classNamestring | undefined—Public Pimolu prop; see the source declaration for details.
childrenRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

id

string | undefined

No default extracted.

Explicit id, instead of the generated one.

className

string | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

PimoluDrawerFooterProps

Type source
PimoluDrawerFooterProps public API
NameTypeDefaultDescription
childrenRequiredReactNode—Public Pimolu prop; see the source declaration for details.
classNamestring | undefined—Public Pimolu prop; see the source declaration for details.
childrenRequired

ReactNode

No default extracted.

Public Pimolu prop; see the source declaration for details.

className

string | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

PimoluDrawerCloseProps

Type source
PimoluDrawerCloseProps public API
NameTypeDefaultDescription
childrenRequiredReactElement<unknown, string | JSXElementConstructor<any>>—The element that closes the drawer: any element, or a component that passes down the props it receives. Its own click handler still runs.
childrenRequired

ReactElement<unknown, string | JSXElementConstructor<any>>

No default extracted.

The element that closes the drawer: any element, or a component that passes down the props it receives. Its own click handler still runs.

Accessibility

  • Provide a title, a close path and verify focus containment and restoration.
Read the accessibility guide →