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).
| Prop | Type | Default | Description |
|---|---|---|---|
itemsrequired | { label: ReactNode; value: ReactNode; wide?: boolean | undefined; }[] | - | The pairs: label and value. |
bordered | boolean | - | Draws lines between items. |
columns | 2 | 3 | 1 | 2 | Columns 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).
| Prop | Type | Default | Description |
|---|---|---|---|
labelrequired | ReactNode | - | What the number is. |
valuerequired | number | - | The number. |
animate | boolean | - | Counts up from 0 when it appears (skipped with reduced motion). |
delta | number | - | Change versus before, e.g. 0.12 for +12%. |
formatOptions | NumberFormatOptions | - | Intl number format (currency, percent, compact). |
higherIsBetter | boolean | true | Is up good? Default true (turns green); false flips the colors (costs, errors). |
prefix | ReactNode | - | Before the number, e.g. "quot;. |
suffix | ReactNode | - | 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.