Bar list
A ranked list with a bar behind each row, such as a site's top pages. The hovered row stays bright while the rest step back, and new values swap the rows into their new order as their numbers roll.
Examples
New data
Rows ordered by value, each bar as long as its value against the largest. Another range swaps the rows into their new order where they are, rolls each value and slides each bar; the row under the pointer stays bright while the rest step back.
Links and Show more
href makes each row a link and icon puts a picture before its name. share writes each row’s part of the total, and past limit the rest wait behind Show more, gliding in as the list grows.
Pick a row
selected and onSelectedChange make each row a toggle, as on every chart: a dashboard filters by the row picked, which stays bright while the rest step back.
Previous
previous names each row’s earlier value: a line along the foot of the row runs as far as it stood, and the row writes its change after its value.
Data order
sort='none' keeps the rows in the data’s order, such as the steps of a sign-up. format writes each value your way, and color gives one row a colour of its own.
Installation
npx shadcn@latest add https://kinoui.com/r/bar-list.json- Files
lib/number-format.tslib/reduce-motion.tslib/refs.tslib/resize.tslib/roll.tsxlib/swap.tsxlib/run-progress.tscomponents/kino/animated-number.tsxcomponents/kino/spinner.tsxcomponents/kino/button.tsxlib/dates.tslib/chart-math.tslib/chart-scale.tslib/chart-frame.tslib/live.tsxlib/chart-live.tslib/chart-live-clock.tsxlib/scroll.tslib/popup.tslib/glide.tsxlib/keys.tsxcomponents/kino/kbd.tsxcomponents/kino/tooltip.tsxlib/cut.tsxlib/announce.tslib/controllable.tslib/chart-root.tsxlib/chart-state.tslib/chart-agent.tslib/chart-base.tsxlib/chart-cartesian-reader.tslib/chart-cartesian.tsxlib/chart-list.tsxlib/chart-list-reader.tslib/chart-tree-reader.tslib/chart-flow-reader.tslib/chart-grid-reader.tslib/highlight.tslib/flow.tslib/placeholder.tslib/sort.tsxcomponents/kino/bar-list.tsx- Packages
@ui-sdk/core@ui-sdk/reactclass-variance-authorityd3-array- Global CSS
- the feels, the density tokens, the shape tokens and the success and warning colours
New to Kino? Installation covers what your project needs first and the @kino namespace.
The CLI keeps any of these colours your project already has, such as the chart colours shadcn init writes. To use Kino’s, set them in your global CSS:
:root { --chart-1: oklch(0.42 0.1 248); --chart-2: oklch(0.53 0.12 222); --chart-3: oklch(0.6 0.11 185); --chart-4: oklch(0.65 0.17 132); --chart-5: oklch(0.72 0.154 106.7); --chart-accent: oklch(0.795 0.171 71.2);}.dark { --chart-1: oklch(0.6 0.15 255); --chart-2: oklch(0.7 0.13 222); --chart-3: oklch(0.79 0.13 185); --chart-4: oklch(0.82 0.15 128); --chart-5: oklch(0.72 0.154 106.7); --chart-accent: oklch(0.795 0.171 71.2);}API reference
Props
The list: a <figure> named by label, holding an ordered list of rows, each with a bar behind it as long as its value against the largest. Other props go to the figure; the props from data to messages are the ones every chart takes.
Data attributes
CSS variables
Accessibility
- The rows are an ordered list, read top to bottom, each with its name, its value and the value’s label, and its share; the bars are hidden from screen readers.
- A row with an
hrefis a link and a row that can be picked is a toggle button witharia-pressed, each a stop in the tab order; plain rows take no focus, since everything in them is read as it is. - A name cut short shows whole in a tooltip, by pointer and by keyboard focus.
- Show more says whether the rows past the limit show, with
aria-expanded. - Loading, an error and new data are announced in a status region.
- Forced colours draw each bar as a line under its row, and a picked row with an outline.
- When the system asks for less motion, rows and bars land at once, and only colours and opacity fade.
For agents
What an agent reads on this example with snapshot(), and the actions it can call with act().
The Agent bridge page sets up snapshot() and act() in your app.