Resizable panels
Let users adjust two side-by-side panes using an accessible range control.
Live preview
Explorer
Resizable side pane
Details
Primary content region
HTML
<div data-xsh-resizable class="xsh-resizable">
<div>
<strong>Explorer</strong>
<p>Resizable side pane</p>
</div>
<div>
<strong>Details</strong>
<p>Primary content region</p>
</div>
</div>
<label class="xsh-field xsh-measure">
<span class="xsh-label">Explorer width (%)</span>
<input type="range" min="25" max="75" value="40" data-xsh-resize-range aria-label="Explorer pane width">
</label>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.
| Identifier | Contract |
|---|---|
xsh-resizable | Used by the example markup and component styles or behavior. |
data-xsh-resizable | Used by the example markup and component styles or behavior. |
data-xsh-resize-range | Used by the example markup and component styles or behavior. |
Accessibility & keyboard
Arrow keys move the range slider, updating the pane ratio without pointer-only dragging.
Implementation note. For complex workstations, persist width preferences in the host application.
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.