Skip to content

DocsDataBars

PT

Data

Bars

Columns that grow on entry, with a tip per column and a total that counts up in the card.

data-u="bars"

Example

Deploys
148 this week

Installation

Bars ships in the full package, in unslop.css and unslop.js:

curl -fsSL unslop.leallabs.dev/i | sh

A ready-made block that uses bars:

curl -fsSL unslop.leallabs.dev/i | sh -s add wall-steps

No build Name-based add is for charts and blocks. Components with JS live in unslop.js, which mounts every data-u on the page by itself.

Props

They go in data-u-props, as JSON.

PropTypeDefaultWhat it does
labelsarray[]One label per column.
seriesarray of arraysno defaultOne series per period. A period in the same card swaps the series.
valuesarrayno defaultSingle series, when there's no period.
maxnumberhighest valueTop of the scale.
colorstringvar(--c3)Bar color. Use a token, like var(--c1).
startnumber0Series it opens on.

Classes and variants

ClassWhat it does
[data-bars-total]On any element in the card: receives the series sum, counting up.

Accessibility and keyboard

State and roles

WhereAttributeWhat it says
each columntabindex="0", aria-label"Mon: 22". The focused column shows the tip.

Keyboard

KeyDoes
Tabmoves through the columns and shows the value

Events and API

el._u.update(props) swaps the props without remounting.

Type to search. Arrows pick, Enter opens.