Alpha: Ships on npm at 7.0.0-alpha.07.0.0-alpha.0
endpoints
An API at a glance: one ruled row per route, with its method, path and job.
Carried by the api-product Template. Seen on pages/harbor/home.json, section 5.
{
"kind": "section",
"shell": {
"inset": "contained",
"density": "section"
},
"block": {
"type": "endpoints",
"head": {
"eyebrow": "The API",
"title": "Four routes, one shape."
},
"rows": [
{
"method": "GET",
"path": "/v1/berths",
"text": "Every berth in a harbor, with its charted depth"
},
{
"method": "GET",
"path": "/v1/berths/{berth}/tides",
"text": "High and low water for one berth"
},
{
"method": "GET",
"path": "/v1/berths/{berth}/window",
"text": "The hours a given draft clears"
},
{
"method": "POST",
"path": "/v1/alerts",
"text": "A webhook before a window closes"
}
]
}
}
{
"title": "endpoints",
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "endpoints"
},
"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
},
"rows": {
"minItems": 3,
"maxItems": 16,
"type": "array",
"items": {
"type": "object",
"properties": {
"method": {
"type": "string",
"enum": [
"GET",
"POST",
"PUT",
"PATCH",
"DELETE"
]
},
"path": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"text": {
"type": "string",
"minLength": 1,
"maxLength": 96
},
"href": {
"type": "string",
"minLength": 1,
"maxLength": 160
}
},
"required": [
"method",
"path",
"text"
],
"additionalProperties": false
}
},
"note": {
"type": "string",
"minLength": 1,
"maxLength": 160
}
},
"required": [
"type",
"head",
"rows"
],
"additionalProperties": false
}{
"kind": "section",
"shell": { "inset": "contained", "density": "section" },
"block": {
"type": "endpoints",
"head": { "eyebrow": "The API", "title": "Four routes, one shape." },
"rows": [
{ "method": "GET", "path": "/v1/berths", "text": "Every berth in a harbor, with its charted depth" },
{ "method": "GET", "path": "/v1/berths/{berth}/tides", "text": "High and low water for one berth" },
{ "method": "GET", "path": "/v1/berths/{berth}/window", "text": "The hours a given draft clears" },
{ "method": "POST", "path": "/v1/alerts", "text": "A webhook before a window closes" }
]
}
}Smallest that parses
{
"type": "endpoints",
"head": { "eyebrow": "The API", "title": "Four routes, one shape." },
"rows": [
{ "method": "GET", "path": "/v1/berths", "text": "Every berth in a harbor, with its charted depth" },
{ "method": "GET", "path": "/v1/berths/{berth}/tides", "text": "High and low water for one berth" },
{ "method": "GET", "path": "/v1/berths/{berth}/window", "text": "The hours a given draft clears" }
]
}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 |
rows | 3–16 × object | yes |
rows[].method | "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | yes |
rows[].path | string ≤64 | yes |
rows[].text | string ≤96 | yes |
rows[].href | string ≤160 | no |
note | string ≤160 | no |
Use instead
api-call: one call with its answer