Skip to content
NewYour data: charts, lists and meters that take your records
<hf-barlist>Custom elementData

Bar list

Ranked bar list with dithered bars behind the labels that grow in one after another; hover or focus runs a sheen along a bar.

View as Markdown
<hf-barlist>

Your data

Pass your label:value rows as data; the read-only items property returns them parsed. Without it the list shows demo file names with invented edit counts. See Your data.

Playground

Change a prop and the component updates. Props marked live animate to the new value; the others rebuild the element.

Loading <hf-barlist>
Props
datalive
labellive
unitlive
<HfBarlist
  data="src/auth/session.ts:184,src/api/client.ts:121,src/ui/composer.tsx:96,tests/auth.spec.ts:58,README.md:21"
  label="Most edited files"
  unit="Edits"
/>

Installation

pnpm dlx shadcn@latest add @lumesec/hf-barlist
First timeRegister the @lumesec registry once, or install by URL

Adds @lumesec to your components.json:

pnpm dlx shadcn@latest registry add @lumesec=https://elements.lumesec.ai/r/{name}.json

Or skip the setup and install by URL:

npx shadcn@latest add https://elements.lumesec.ai/r/hf-barlist.json

Usage

import { HfBarlist } from "@/components/lumesec/hf-barlist";

export function Example() {
  return (
    <HfBarlist label="Most edited files" unit="Edits" />
  );
}

Behaviour

Ranked rows with dithered bars behind the labels. They grow in one after another, and hovering a row runs a sheen along its bar.

API reference

Attributes

dataReact propdataTypestringDefaultsrc/auth/session.ts:184,src/api/client.ts:121,src/ui/composer.tsx:96,tests/auth.spec.ts:58,README.md:21

Comma-separated label:value rows, split at the last colon; an entry without a colon has the value 0. Rows are sorted by value, highest first. Observed: a new value rebuilds the rows.

labelReact proplabelTypestringDefaultMost edited files

Header text on the left; also labels the list. Observed.

unitReact propunitTypestringDefaultEdits

Header text on the right, above the values. Observed.

Properties

items (read-only)TypeArray<{ label: string, v: number }>

Rows parsed from data, sorted by value, highest first.

Accessibility

  • The rows form a role="list" labelled by the header; each row is a listitem with tabindex="0" and an aria-label of the form label: value.
  • The canvas is aria-hidden.
  • Focusing a row runs the same sheen as hover.
  • Reduced motion: the bars appear at full width without growing and no sheen runs; the hover highlight still fades.

Theming

The element reads your shadcn theme tokens through its shadow root, so light and dark follow your theme. The accent comes from --lumesec. See Theming.

This component reads --foreground, --lumesec and --muted-foreground.

To restyle only LumeSec elements, set the matching --ui-* overrides: --ui-accent, --ui-fg, --ui-mono and --ui-muted.

Notes

  • Bar lengths are relative to the largest value; negative values get no bar.
  • Changing data rebuilds the rows and the bars grow in again; focus stays on the same row position.

Was this page helpful?