xxshna.ui
V 1.1.0Get started ↗

Date range fields

Pair date inputs with an explicit start and end relationship.

Catalog · 1.1HTML, CSS & optional JSNo runtime dependencies

Live preview

Interactive exampleOpen playground ↗
Reporting period
HTML
<fieldset class="xsh-fieldset">
<legend>Reporting period</legend>
<div class="xsh-grid">
<label class="xsh-field">
<span class="xsh-label">From</span>
<input class="xsh-input" type="date" value="2026-10-01" data-xsh-range-start>
</label>
<label class="xsh-field">
<span class="xsh-label">To</span>
<input class="xsh-input" type="date" value="2026-10-30" data-xsh-range-end>
</label>
</div>
<small class="xsh-help" data-xsh-range-error role="status">
</small>
</fieldset>

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-fieldsetUsed by the example markup and component styles or behavior.
data-xsh-range-startUsed by the example markup and component styles or behavior.
data-xsh-range-endUsed by the example markup and component styles or behavior.
data-xsh-range-errorUsed by the example markup and component styles or behavior.

Accessibility & keyboard

Start-date changes constrain the minimum end date and reveal reversed ranges.

Implementation note. Use the browser locale for display; validate boundaries on the backend.

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.