Skip to main content
VelinStyle v1.3.0
⌂ Home
  1. Docs
  2. Components
  3. Overlays
  4. Drawer

Drawer 1.2.2

<velin-drawer> slides an off-canvas panel from any side with overlay, focus trap, and scroll lock. In 1.2.0, lifecycle uses focus-manager for background inert + overflow locking. Deutsch: Schublade

Maturity: Documented as stable in VelinStyle 1.2.0. Design Intelligence (plan / review / agent meta) is separate and beta / foundation where noted.

When to use

When not

Basic example

Drawer content goes here.

<velin-drawer title="Navigation" id="myDrawer">
  <p>Drawer content goes here.</p>
</velin-drawer>

<button type="button" class="velin-btn velin-btn--primary"
        onclick="document.getElementById('myDrawer').open()">
  Open Drawer
</button>

Four sides

Use side: start (default), end, top, or bottom. Positioning uses logical inset properties so start/end flip in RTL.

<velin-drawer side="start" title="Menu">…</velin-drawer>
<velin-drawer side="end" title="Filters">…</velin-drawer>
<velin-drawer side="top" title="Banner">…</velin-drawer>
<velin-drawer side="bottom" title="Actions">…</velin-drawer>

Accessibility

Dark, responsive, motion, RTL

API

Attributes

AttributeTypeDescription
openBooleanObserved — presence opens the drawer
sideStringstart | end | top | bottom
titleStringHeader title (escaped) + labelling

Methods, events, parts

APIDescription
open() / close()Toggle visibility; close() fires velin-close
velin-closeBubbling close event
Partsoverlay, drawer, header, body, close
Default slotDrawer body

CSS variables

VariableDescription
--velin-color-overlayBackdrop
--velin-color-surface-brightPanel background
--velin-shadow-xlPanel shadow
--velin-z-overlayBackdrop z-index (400)
--velin-z-modalPanel z-index (500)

Best practices & pitfalls