Skip to content
Alea0.1

Data display

Descriptions and Statistic

Key and value pairs, and big numbers with their change.

Ant Design: Descriptions, Statistic

import { Descriptions, Statistic } from '@alea/ui';

Examples

Descriptions

Key and value pairs in columns.

Plan
Lab Pro yearly
Status
Active
Renews
October 17, 2027
Seats
3 of 5
License key
FL-8K2D-Q9XA-77PL

Statistic

Big numbers with their change, counted up when they appear.

Plugin users
5,725
+18%up from before
Revenue
$2,480
+7%up from before
Refunds
3
+50%up from before

Props

Descriptions props

Key and value pairs: order details, profile facts, settings summaries (Ant's Descriptions).

PropTypeDefaultDescription
itemsrequired{ label: ReactNode; value: ReactNode; wide?: boolean | undefined; }[]-The pairs: label and value.
borderedboolean-Draws lines between items.
columns2 | 3 | 12Columns on wide screens. Default 2.
layout"inline" | "stacked"'stacked'inline puts label and value side by side.

Statistic props

A big number with its label and change (Ant's Statistic).

PropTypeDefaultDescription
labelrequiredReactNode-What the number is.
valuerequirednumber-The number.
animateboolean-Counts up from 0 when it appears (skipped with reduced motion).
deltanumber-Change versus before, e.g. 0.12 for +12%.
formatOptionsNumberFormatOptions-Intl number format (currency, percent, compact).
higherIsBetterbooleantrueIs up good? Default true (turns green); false flips the colors (costs, errors).
prefixReactNode-Before the number, e.g. "quot;.
suffixReactNode-After the number, e.g. " ms".

Accessibility

  • Descriptions is a definition list.
  • Statistic says the change in words (up or down from before), not only with color.

Do and don't

Do

  • Use it for read-only details: an order, a profile.
  • Put the most important items first.

Don't

  • Don't use it for editable data: use a Form.
  • Don't put long paragraphs in a value: span the whole row with wide.
Tested with axe, keyboard and screen reader roles