Skip to content

Internal ID software / Data

StatCard

One number with its name, its change and its source.

Not drawn in Figma: built only from the tokens, for internal ID software. In code: components/software/stat-card.tsx. From the old system: StatCard in @id-identity-as/ui/data.

Example

Åbne ordrer

12

Eksempeldata

Genbestilling

68 %

+4 procentpointi forhold til forrige kvartal

Eksempeldata

Returneret

1.240

-80færre end sidste måned

Eksempeldata

Åbne ordrer

12

Eksempeldata

Genbestilling

68 %

+4 procentpointi forhold til forrige kvartal

Eksempeldata

Returneret

1.240

-80færre end sidste måned

Eksempeldata

import { StatCard } from '@/components/software/stat-card';

<StatCard label="Åbne ordrer" value="12" delta="+3" deltaDirection="up" deltaBasis="i forhold til sidste uge" source="Eksempeldata" />

Props

PropTypeDefaultWhat it does
label (required)stringWhat is measured.
value (required)stringThe number, already formatted: "1.240" or "68 %". Never computed in the card.
deltastringThe change, already formatted.
deltaDirection'up' | 'down'Draws an arrow beside the change. The direction is not a verdict.
deltaBasisstringWhat the change is measured against.
sourcestringWhere the number comes from and what period it covers.

Do

  • Format the number the Danish way before it comes in: 1.234,56.
  • Say in words whether a change is good. Returns going down is an arrow down that is good.
  • Name the source, and mark example data as example data.

Do not

  • Do not colour the change green or red.
  • Do not animate the number.
  • Do not invent a figure to fill a tile.

Accessibility

  • A section named by its label.
  • The arrow is decorative; the change is text.

Tokens it uses

  • color.surface.base
  • color.border.default
  • color.software.muted
  • radius.sm
  • type.display.sm
  • type.heading.sm
  • type.body.sm
  • space.inline.1
  • space.inline.2
  • space.inline.5