Drawer
BetaFeedback and overlaysOpen in the workshop
A side panel for details or edits while the list stays in view.
dialog.xg-drawer > .xg-modal__header + .xg-modal__body + .xg-modal__footer · --static for documentationExample and markup
Live, from xg-ui.css and xg-ui.js. Switch the brand and mode on the example itself, or for the whole site in the header.
Markup
<button class="xg-btn xg-btn--secondary" type="button" data-xg-open="dlg-drawer">
<svg class="xg-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
<path d="M3 5h18l-7 8.5V19l-4 2v-7.5L3 5Z"/>
</svg>All filters</button>
<dialog class="xg-drawer" id="dlg-drawer" aria-labelledby="dlg-drawer-t">
<form method="dialog" style="display:contents">
<div class="xg-modal__header">
<h2 class="xg-modal__title" id="dlg-drawer-t">Filters</h2>
<button class="xg-btn xg-btn--ghost xg-btn--icon xg-btn--sm" data-xg-close aria-label="Close">
<svg class="xg-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false">
<path d="M18 6 6 18"/>
<path d="m6 6 12 12"/>
</svg>
</button>
</div>
<div class="xg-modal__body">
<div class="xg-field">
<label class="xg-label" for="f-country">Country</label>
<select class="xg-select" id="f-country">
<option>All countries</option>
<option>United States</option>
<option>Germany</option>
</select>
</div>
<fieldset class="xg-fieldset">
<legend class="xg-label">Status</legend>
<label class="xg-check">
<input type="checkbox" checked>Live</label>
<label class="xg-check">
<input type="checkbox">Paused</label>
<label class="xg-check">
<input type="checkbox">In review</label>
</fieldset>
</div>
<div class="xg-modal__footer">
<button class="xg-btn xg-btn--ghost" value="reset">Reset</button>
<button class="xg-btn" value="apply">Show 128 results</button>
</div>
</form>
</dialog>When to use it
Use it for
row details from a table, filters with many fields, a request log entry.
Not for
tasks that need the whole screen.
Rules
- Opens from the right, 440 px wide, full height.
- Title names the object; the footer holds its actions.
Accessibility
- Native <dialog>, same as Modal.
Every color pair this component uses is measured for both brands in light and dark on the Accessibility page.
Related
Also in Feedback and overlays: Modal, Alert dialog, Toast, Alert, Popover. Used in the patterns Forms and overlays.
Status Beta: usable; class names may still change in a minor release, with a note (see Releasing).