Charts A
Stage bars
Stages as horizontal bars with an icon, value and share, plus tiles.
Example
Stage bars
The sales funnel as horizontal bars with an icon, value and share for each stage, plus a grid of tiles.
<article class="u-chart-card">
<div class="u-chart-panel">
<div data-u="stages" data-u-props='{
"label": "Sales pipeline",
"stages": [
{"label": "Lead", "icon": "eye"},
{"label": "Contact", "icon": "user-plus"},
{"label": "Proposal", "icon": "bolt"},
{"label": "Negotiation", "icon": "crown"},
{"label": "Closed", "icon": "users"},
{"label": "Expansion", "icon": "building"}
],
"periods": [
{
"label": "Last 7 days",
"delta": 3.2,
"values": [960, 640, 410, 240, 130, 52]
},
{
"label": "Last 30 days",
"delta": 5.6,
"values": [4120, 2760, 1730, 980, 540, 218]
},
{
"label": "Last 90 days",
"delta": 2.1,
"values": [12800, 8300, 5100, 2900, 1620, 640]
}
]
}'></div>
</div>
<h3 class="u-chart-title">Stage bars</h3>
<p class="u-chart-desc">The sales funnel as horizontal bars with an icon, value and share for each stage, plus a grid of tiles.</p>
</article>Installation
Just this chart, with the core and the tokens:
curl -fsSL unslop.leallabs.dev/i | sh -s add stagesNo dependency The chart file already brings its own shell.
The full card from the example, as HTML ready to paste:
curl -fsSL unslop.leallabs.dev/i | sh -s add chart-stagesFamily A: shell u-chart-card > u-chart-panel > the data-u, then h3.u-chart-title and p.u-chart-desc.
Props
They go in data-u-props, as JSON. Each item in periods becomes an option in the picker and the chart animates from the old data to the new.
| Prop | Type | Default | What it does |
|---|---|---|---|
label | string | no default | Small label at the top of the card. |
stages | array | no default | List of {label, icon}. icon: eye, user-plus, bolt, crown, users or building (anything else falls back to eye). |
periods | array | no default | List of {label, delta, values}. |
period | number | 0 | Index of the period that opens selected. |
Accessibility and keyboard
State and roles
| Where | Attribute | What it says |
|---|---|---|
| chart svg | role="img" and aria-label | "Label by stage". |
| period toggle | role="radiogroup", role="radio" | Current period in aria-checked. |
| period list | role="listbox", role="option" | Opens with aria-expanded and marks the option in aria-selected. |
Keyboard
| Key | Does |
|---|---|
| Left and right arrows | change the period in the toggle |
| Enter or Space | opens the period list |
| Up and down arrows | moves through the options |
| Esc | closes without changing |
| Tab | closes and moves focus on |
Events and API
No public events. The period change happens inside the card.