Components
Data components
Every data component a card can use, with its properties and an example.
Each component is an object with a type and the properties listed for it. Text and number properties may also hold a {{ }} template or a { "$bind": "…" } object; see Data, state and bindings. Every component also accepts the common properties.
stat
One figure with a label and an optional change indicator.
Does not take children.
| Property | Type | Required | Default | What it does |
|---|---|---|---|---|
label | text | yes | What the figure measures. | |
value | any JSON | yes | The figure. | |
unit | text | Unit shown after the figure. | ||
delta | text | Change since last period, e.g. +12%. | ||
trend | "up" "down" "flat" | Direction of the change. | ||
good | "up" "down" | "up" | Which direction counts as good. Colors the delta. |
{
"type": "stat",
"label": "Visitors",
"value": "1,284",
"delta": "+12%",
"trend": "up"
}progress
A progress bar.
Does not take children.
| Property | Type | Required | Default | What it does |
|---|---|---|---|---|
value | number | yes | Current value. | |
max | number | 100 | Value at 100%. | |
label | text | Label above the bar. | ||
showValue | boolean | Show the percentage. | ||
tone | "primary" "success" "warning" "danger" | "primary" | Bar color. |
{
"type": "progress",
"value": 64,
"label": "Disk",
"showValue": true
}meter
A ring gauge for a value within a range.
Does not take children.
| Property | Type | Required | Default | What it does |
|---|---|---|---|---|
value | number | yes | Current value. | |
max | number | 100 | Top of the range. | |
label | text | Label under the figure. | ||
unit | text | Unit after the figure. | ||
tone | "primary" "success" "warning" "danger" | "primary" | Ring color. |
{
"type": "meter",
"value": 72,
"unit": "%",
"label": "CPU"
}keyValue
A list of label and value pairs.
Does not take children.
| Property | Type | Required | Default | What it does |
|---|---|---|---|---|
items | list of objects | yes | The rows. | |
items[].label | text | yes | Label. | |
items[].value | any JSON | yes | Value. | |
layout | "rows" "columns" | "rows" | Rows put the value on the right; columns stack them. |
{
"type": "keyValue",
"items": [
{
"label": "Status",
"value": "Running"
},
{
"label": "Region",
"value": "eu-north"
}
]
}table
A table of rows.
Does not take children.
| Property | Type | Required | Default | What it does |
|---|---|---|---|---|
columns | list of objects | yes | The columns. | |
columns[].key | text | yes | Key of each row to show. | |
columns[].label | text | Column heading. | ||
columns[].align | "start" "end" | Alignment. | ||
columns[].format | "text" "number" "date" "datetime" "relative" "badge" | How to format values. | ||
rows | any JSON | yes | A list of row objects, usually a binding. | |
empty | text | "Nothing here" | Text shown when there are no rows. | |
maxRows | number | Show at most this many rows. |
{
"type": "table",
"columns": [
{
"key": "day",
"label": "Day"
},
{
"key": "visits",
"label": "Visits",
"align": "end",
"format": "number"
}
],
"rows": [
{
"day": "Mon",
"visits": 120,
"signups": 8
},
{
"day": "Tue",
"visits": 180,
"signups": 14
},
{
"day": "Wed",
"visits": 150,
"signups": 11
},
{
"day": "Thu",
"visits": 210,
"signups": 19
},
{
"day": "Fri",
"visits": 260,
"signups": 23
}
]
}list
A simple list of items, each with a title and optional details.
Does not take children.
| Property | Type | Required | Default | What it does |
|---|---|---|---|---|
items | list of objects | yes | The items. | |
items[].title | text | yes | Main line. | |
items[].description | text | Second line. | ||
items[].icon | icon name | Leading icon. | ||
items[].meta | text | Short text on the right. | ||
items[].href | URL | Makes the item a link. | ||
empty | text | "Nothing here" | Text shown when the list is empty. |
{
"type": "list",
"items": [
{
"title": "First item",
"description": "A detail",
"icon": "circle-check"
},
{
"title": "Second item",
"meta": "2m"
}
]
}