Internal ID software / Data
BarList
A ranked list with a bar behind each number. Layout, not a chart.
Not drawn in Figma: built only from the tokens, for internal ID software. In code: components/software/bar-list.tsx. From the old system: BarList in @id-identity-as/ui/data.
Example
- Række A1.425
- Række B980
- Række C610
- Øvrige340
- Række A1.425
- Række B980
- Række C610
- Øvrige340
import { BarList } from '@/components/software/bar-list';
<BarList
title="Mest bestilte"
note="Eksempeldata, antal stk."
rows={[
{ label: 'Række A', value: 1425, text: '1.425' },
{ label: 'Række B', value: 980, text: '980' },
]}
/>Props
| Prop | Type | Default | What it does |
|---|---|---|---|
title (required) | string | What is compared. | |
note | string | The period and the unit. | |
rows (required) | BarListRow[] | { label, value, text }. value draws the bar; text is the number as shown, already formatted. |
Do
- Keep the order of the rows fixed when the data updates.
- Write the unit in the note.
Do not
- Do not give the bars different colours. One colour, the text colour.
- Do not animate the bars.
- Do not use it where an axis or a time line is needed. Charts are not in the system yet: ask first.
Accessibility
- Every value is text beside its bar; the bar itself is hidden from screen readers.
Tokens it uses
- color.surface.base
- color.border.default
- color.text.default
- color.software.muted
- radius.sm
- type.heading.md
- type.body.sm
- space.inline.1
- space.inline.2
- space.inline.3
- space.inline.4
- space.inline.5