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.
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.
<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-barlistFirst 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}.jsonOr skip the setup and install by URL:
npx shadcn@latest add https://elements.lumesec.ai/r/hf-barlist.jsonUsage
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:21Comma-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 filesHeader text on the left; also labels the list. Observed.
unitReact propunitTypestringDefaultEditsHeader 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 alistitemwithtabindex="0"and anaria-labelof the formlabel: 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
datarebuilds the rows and the bars grow in again; focus stays on the same row position.
Related
Was this page helpful?