xxshna.ui
V 1.1.0Get started ↗
Components/Overlays

Drawers

Expose secondary workflows in a focused side panel.

Catalog · 1.1HTML, CSS & optional JSNo runtime dependencies

Live preview

Interactive exampleOpen playground ↗

Workspace details

Review settings without navigating away from your current page.

HTML
<button class="xsh-button" data-xsh-dialog-open="xsh-example-drawer">Open details panel →</button>
<dialog class="xsh-drawer" id="xsh-example-drawer" aria-labelledby="xsh-example-drawer-title">
<div class="xsh-dialog__header">
<h2 class="xsh-dialog__title" id="xsh-example-drawer-title">Workspace details</h2>
</div>
<div class="xsh-dialog__body">
<div class="xsh-field">
<label class="xsh-label" for="xsh-drawer-name">Workspace name</label>
<input id="xsh-drawer-name" class="xsh-input" value="Northstar Studio">
</div>
<p>Review settings without navigating away from your current page.</p>
</div>
<div class="xsh-dialog__footer">
<button class="xsh-button xsh-button--secondary" data-xsh-dialog-close>Cancel</button>
<button class="xsh-button" data-xsh-dialog-close data-xsh-toast="success" data-xsh-message="Workspace settings updated.">Save changes</button>
</div>
</dialog>

Installation & markup

Include the local stylesheet and script once on the page, then place the component inside a data-xsh-ui root. The example above works without a build system.

<link rel="stylesheet" href="/dist/xshna-ui.css">
<div data-xsh-ui>
  <!-- Add the HTML example above -->
</div>
<script defer src="/dist/xshna-ui.js"></script>

Component API

Public classes, attributes and hooks used by this example. Keep the xsh- prefix intact.

IdentifierContract
xsh-drawerUsed by the example markup and component styles or behavior.
xsh-dialog__headerUsed by the example markup and component styles or behavior.
xsh-dialog__bodyUsed by the example markup and component styles or behavior.
xsh-dialog__footerUsed by the example markup and component styles or behavior.
data-xsh-dialog-openUsed by the example markup and component styles or behavior.

Accessibility & keyboard

Uses native modal dialog interaction. Tab stays inside and Escape closes the drawer.

Implementation note. Use a drawer for contextual editing rather than for blocking, multi-step transactions.

Interaction contract

Behavioral components use the shared delegated runtime; visual-only primitives rely on semantic HTML and CSS. Runtime controls emit bubbling xsh:* CustomEvents; bind application handlers to those events when server persistence, API data or navigation is required.