Alpha: Ships on npm at 7.0.0-alpha.07.0.0-alpha.0
stats
A band of three or four big numbers with captions, ruled between cells.
Seen on pages/home.json, the landing, section 2.
Count
{
"kind": "band",
"shell": {
"inset": "contained",
"density": "compact"
},
"block": {
"type": "stats",
"items": [
{
"value": "27",
"label": "Section types, drawn once by hand"
},
{
"value": "64",
"label": "Characters a hero title holds"
},
{
"value": "7 KB",
"label": "One record, this whole page"
}
]
}
}
{
"title": "stats",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "stats"
},
"head": {
"type": "object",
"properties": {
"eyebrow": {
"type": "string",
"minLength": 1,
"maxLength": 28
},
"title": {
"type": "string",
"minLength": 1,
"maxLength": 72
},
"lede": {
"type": "string",
"minLength": 1,
"maxLength": 300
},
"max": {
"type": "string",
"pattern": "^(none|\\d+(\\.\\d+)?(em|ch|px))$"
},
"ledeMax": {
"type": "string",
"pattern": "^(none|\\d+(\\.\\d+)?(em|ch|px))$"
},
"balance": {
"type": "boolean"
},
"scale": {
"type": "string",
"enum": [
"compact",
"large"
]
},
"tag": {
"type": "string",
"minLength": 1,
"maxLength": 8
},
"layout": {
"type": "string",
"enum": [
"split"
]
}
},
"required": [
"eyebrow"
],
"additionalProperties": false
},
"items": {
"minItems": 3,
"maxItems": 4,
"type": "array",
"items": {
"type": "object",
"properties": {
"value": {
"type": "string",
"minLength": 1,
"maxLength": 6
},
"label": {
"type": "string",
"minLength": 1,
"maxLength": 72
},
"icon": {
"type": "string",
"enum": [
"activity",
"anchor",
"arrow-right",
"arrow-up-right",
"badge-check",
"bell",
"blocks",
"bot",
"check",
"chevron-down",
"chevron-left",
"chevron-right",
"clock",
"code",
"compass",
"copy",
"credit-card",
"database",
"file-code-2",
"file-text",
"files",
"film",
"fingerprint",
"gauge",
"git-commit-horizontal",
"globe",
"history",
"key-round",
"landmark",
"layers",
"layout-grid",
"library",
"link",
"list",
"map-pin",
"menu",
"message-square",
"mic",
"plug",
"radar",
"refresh-cw",
"search",
"shield-check",
"ship",
"shopping-cart",
"sliders-horizontal",
"sparkles",
"terminal",
"ticket",
"waves",
"webhook",
"x"
]
}
},
"required": [
"value",
"label"
],
"additionalProperties": false
}
}
},
"required": [
"type",
"items"
],
"additionalProperties": false
}{
"kind": "band",
"shell": { "inset": "contained", "density": "compact" },
"block": {
"type": "stats",
"items": [
{ "value": "27", "label": "Section types, drawn once by hand" },
{ "value": "64", "label": "Characters a hero title holds" },
{ "value": "7 KB", "label": "One record, this whole page" }
]
}
}Smallest that parses
{
"type": "stats",
"items": [
{ "value": "27", "label": "Section types, drawn once by hand" },
{ "value": "64", "label": "Characters a hero title holds" },
{ "value": "7 KB", "label": "One record, this whole page" }
]
}Props
From @mdxui/site@7.0.0-alpha.0. A count reads as min–max × item; a string bound is its maximum length in characters, and links its refusal.
| Prop | Type and bound | Required |
|---|---|---|
head | object | no |
head.eyebrow | string ≤28 | yes |
head.title | string ≤72 | no |
head.lede | string ≤300 | no |
head.max | string (pattern) | no |
head.ledeMax | string (pattern) | no |
head.balance | boolean | no |
head.scale | "compact" | "large" | no |
head.tag | string ≤8 | no |
head.layout | "split" | no |
items | 3–4 × object | yes |
items[].value | string ≤6 | yes |
items[].label | string ≤72 | yes |
items[].icon | icon or mark name (52) | no |
Use instead
facts: labels and values a reader decides on