Drawer

A panel that slides in from an edge, built on the native <dialog>. Temporary (default) is modal with a backdrop; persistent is non-modal.

Placements

startendtopbottom persistent
drawer.html
html
1 <nana-drawer id="d" placement="end">
2 <span slot="header">Filters</span>
3 <p>Drawer body…</p>
4 <nana-button slot="footer" variant="primary" onclick="d.close()">Done</nana-button>
5 </nana-drawer>
6 <nana-button onclick="d.show()">Open</nana-button>

Import

main.ts
ts
1 import "@nana-tec/ui-components/drawer";

Props

AttributeTypeDefault
openbooleanfalse
placementstart | end | top | bottomend
persistentbooleanfalse
no-backdrop-closebooleanfalse
no-escape-closebooleanfalse

Methods: show() / close(). Events: nana-open / nana-close.

start drawer

Slides in from the start edge. Click the backdrop or press Escape to close.

Done
end drawer

Slides in from the end edge. Click the backdrop or press Escape to close.

Done
top drawer

Slides in from the top edge. Click the backdrop or press Escape to close.

Done
bottom drawer

Slides in from the bottom edge. Click the backdrop or press Escape to close.

Done
Persistent

Non-modal — no backdrop, doesn't block the page.

Close