Alpha: Ships on npm at 7.0.0-alpha.07.0.0-alpha.0
compare
Two columns side by side: what the old way costs and what this one gives.
Carried by the api-product Template. Seen on pages/harbor/home.json, section 8.
{
"kind": "section",
"shell": {
"inset": "contained",
"density": "section"
},
"block": {
"type": "compare",
"head": {
"eyebrow": "Against station tables",
"title": "The berth, not the nearest station."
},
"cons": {
"label": "Station tables",
"items": [
"Heights at the station",
"One PDF per month",
"Datum in the small print",
"Math done by hand"
]
},
"pros": {
"label": "Harbor tides",
"items": [
"Heights at the berth",
"Fourteen days per call",
"Datum on every height",
"The window computed"
]
}
}
}
{
"title": "compare",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "compare"
},
"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
},
"cons": {
"type": "object",
"properties": {
"label": {
"type": "string",
"minLength": 1,
"maxLength": 24
},
"items": {
"minItems": 1,
"maxItems": 8,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 56
}
}
},
"required": [
"label",
"items"
],
"additionalProperties": false
},
"pros": {
"type": "object",
"properties": {
"label": {
"type": "string",
"minLength": 1,
"maxLength": 24
},
"items": {
"minItems": 1,
"maxItems": 8,
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"maxLength": 56
}
}
},
"required": [
"label",
"items"
],
"additionalProperties": false
}
},
"required": [
"type",
"head",
"cons",
"pros"
],
"additionalProperties": false
}{
"kind": "section",
"shell": { "inset": "contained", "density": "section" },
"block": {
"type": "compare",
"head": { "eyebrow": "Against station tables", "title": "The berth, not the nearest station." },
"cons": {
"label": "Station tables",
"items": ["Heights at the station", "One PDF per month", "Datum in the small print", "Math done by hand"]
},
"pros": {
"label": "Harbor tides",
"items": ["Heights at the berth", "Fourteen days per call", "Datum on every height", "The window computed"]
}
}
}Smallest that parses
{
"type": "compare",
"head": { "eyebrow": "Against station tables", "title": "The berth, not the nearest station." },
"cons": {
"label": "Station tables",
"items": ["Heights at the station"]
},
"pros": {
"label": "Harbor tides",
"items": ["Heights at the berth"]
}
}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 | yes |
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 |
cons | object | yes |
cons.label | string ≤24 | yes |
cons.items | 1–8 × string ≤56 | yes |
pros | object | yes |
pros.label | string ≤24 | yes |
pros.items | 1–8 × string ≤56 | yes |
Use instead
plan-table: plans, not approaches