Skip to content

Bar List

A ranked list of horizontal bars with each value in mono on the right.

Download
Customize

Rank numbers stay put while rows slide between them on springs when the data re-ranks, and a bar's leading edge glints while it is still resizing. Point at a row, or use the arrow keys, and the rest recede. Options on the viz-kit: dot bars on a unit lattice, hatched remaining tracks, gradient and pattern fills, a dashed reference line with a value pill, positive and negative rows diverging from zero, one selected row in the accent, a tooltip panel, sort order, mass-by-value landing, and loading and empty states.

Install

npx shadcn@latest add https://obsydeui.com/r/bar-list.json

Usage

Import it from where the CLI puts it, or copy the files below by hand.

import { BarList } from '@/components/obsyde/ember/bar-list/BarList';

export function Example() {
  return (
    <BarList />
  );
}

Files

Plain React, TypeScript and CSS. No dependencies. The download keeps these paths.

  • ember/bar-list/BarList.tsxcomponent
  • ember/bar-list/bar-list.cssstyles
  • ember/bar-list/BarListDemo.tsxdemo
  • ember/viz-kit/viz-kit.cssshared
  • ember/viz-kit/Tooltip.tsxshared
  • ember/viz-kit/focus.tsshared
  • ember/viz-kit/patterns.tsxshared
  • ember/viz-kit/roll.tsshared
  • ember/shared/rolling-number.cssshared
  • ember/shared/spring.tsshared
  • ember/shared/accent.tsshared
  • ember/viz-kit/scale.tsshared
  • ember/viz-kit/motion.tsshared
  • ember/viz-kit/chart.tsxshared
  • ember/shared/ember.cssshared
  • ember/viz-kit/touch.tsshared
  • ember/viz-kit/keyboard.tsshared
  • ember/viz-kit/size.tsshared
  • ember/shared/RollingNumber.tsxshared

API

PropTypeDefault
accentAccent'ember' | 'volt' | 'arc''ember'
rowsRowsnumber8
compactCompactbooleanfalse
labelPositionLabel position'inside' | 'over''inside'
shapeShape'bar' | 'dots''bar'
fillFill'solid' | 'gradient''solid'
trackTrack'none' | 'hatch' | 'solid''none'
referenceReference'none' | 'avg' | 'median''none'
selectedSelected ranknumber0
signedPositive & negativebooleanfalse
sortSort'desc' | 'asc' | 'none''desc'
showShareShow sharebooleantrue
unitUnitstring—
autoShuffleAuto shufflebooleanfalse
hoverHover'soft' | 'hot''soft'
tooltipTooltip'none' | 'panel''none'
patternPattern'none' | 'diagonal-up' | 'diagonal-down' | 'dots' | 'vertical' | 'crosshatch''none'
statusStatus'ready' | 'loading' | 'empty''ready'
seedSeednumber1