xxshna.ui
V 1.1.0Get started ↗
Components/Data display

Bar charts

Present a small labeled comparison using proportional visual bars.

Catalog · 1.1HTML, CSS & optional JSNo runtime dependencies

Live preview

Interactive exampleOpen playground ↗
Q138
Q267
Q352
Q489
Illustrative quarterly index (0–100)
HTML
<figure class="xsh-bars" role="group" aria-label="Example sales by quarter">
<div>
<span>Q1</span>
<i style="--xsh-value:38%">
</i>
<b>38</b>
</div>
<div>
<span>Q2</span>
<i style="--xsh-value:67%">
</i>
<b>67</b>
</div>
<div>
<span>Q3</span>
<i style="--xsh-value:52%">
</i>
<b>52</b>
</div>
<div>
<span>Q4</span>
<i style="--xsh-value:89%">
</i>
<b>89</b>
</div>
<figcaption>Illustrative quarterly index (0–100)</figcaption>
</figure>

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-barsUsed by the example markup and component styles or behavior.
--xsh-valueUsed by the example markup and component styles or behavior.
figureUsed by the example markup and component styles or behavior.

Accessibility & keyboard

Each numeric value is presented as text, not color alone.

Implementation note. This component illustrates bars, not a full plotting or chart analytics engine.

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.