xxshna.ui
V 1.1.0Get started ↗

Sliders

Set an approximate numeric value within a known range.

Catalog · 1.1HTML, CSS & optional JSNo runtime dependencies

Live preview

Interactive exampleOpen playground ↗
42%
Arrow keys adjust the value; Home and End jump to bounds.
HTML
<div class="xsh-stack" style="max-width:410px;width:100%">
<div class="xsh-row" style="justify-content:space-between">
<label class="xsh-label" for="xsh-demo-volume">Target allocation</label>
<strong>
<output id="xsh-demo-range-value">42</output>%</strong>
</div>
<input id="xsh-demo-volume" class="xsh-range" type="range" min="0" max="100" value="42" data-xsh-output="xsh-demo-range-value">
<small class="xsh-help">Arrow keys adjust the value; Home and End jump to bounds.</small>
</div>

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-rangeUsed by the example markup and component styles or behavior.
data-xsh-outputUsed by the example markup and component styles or behavior.

Accessibility & keyboard

Native range input supports arrows, Home/End and assistive technology value announcements.

Implementation note. Display the current numeric value visibly to avoid forcing interpretation from thumb position.

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.