Components
Drawer
A panel that slides in from an edge — filters, details, settings, forms. Same parts and behavior as the dialog.
<button class="btn btn-default" data-moey-open="#filters">Filters</button>
<dialog class="drawer" id="filters" aria-labelledby="filters-title">
<div class="dialog-header">
<h2 class="dialog-title" id="filters-title">Filters</h2>
<button class="btn-close" aria-label="Close"></button>
</div>
<div class="dialog-body">…</div>
<div class="dialog-footer">…</div>
</dialog>
| Class | What it does |
|---|---|
.drawer | Slides in from the end (right in left-to-right languages) |
.drawer-start · -top · -bottom | Other edges |
.drawer-sm · .drawer-lg | 288 · 576px (default 384px). Or set --mo-drawer-size. |
.drawer-inset | Floats as a rounded panel with a gap from the edges |
The footer sticks to the bottom and only the body scrolls. A click outside doesn't close it unless you add data-moey-close-outside="true" (examples). Opening, closing, static mode, events and Moey.open() work exactly like the dialog.
Sizes
<dialog class="drawer drawer-sm">…</dialog> <!-- 288px -->
<dialog class="drawer">…</dialog> <!-- 384px -->
<dialog class="drawer drawer-lg">…</dialog> <!-- 576px -->
Record details
Open details next to a list without leaving it.
<button class="btn" data-moey-open="#dr-order"><i class="mi mi-receipt"></i>Order #10421</button>
<dialog class="drawer drawer-inset" id="dr-order" aria-labelledby="dr-order-t">
<div class="dialog-header">
<div>
<h2 class="dialog-title" id="dr-order-t">Order #10421</h2>
<p class="dialog-description">Placed Nov 21, 2026</p>
</div>
<button class="btn-close" aria-label="Close"></button>
</div>
<div class="dialog-body grid grid-cols-1 gap-5">
<dl class="dl dl-divided">
<dt>Customer</dt>
<dd>Ana Kim</dd>
<dt>Status</dt>
<dd>
<span class="badge badge-green badge-subtle badge-dot">Paid</span>
</dd>
<dt>Total</dt>
<dd><strong>$129.00</strong></dd>
</dl>
<ol class="timeline timeline-sm">
<li class="theme-green">
<div class="timeline-content">
<div class="timeline-title">Paid</div>
<time class="timeline-time">10:25</time>
</div>
</li>
<li>
<div class="timeline-content">
<div class="timeline-title">Order placed</div>
<time class="timeline-time">10:24</time>
</div>
</li>
</ol>
</div>
<div class="dialog-footer">
<button class="btn btn-red btn-subtle">Refund</button>
<button class="btn btn-default" data-moey-dismiss>Done</button>
</div>
</dialog>