Alpha: Ships on npm at 7.0.0-alpha.07.0.0-alpha.0

bento

Two to four panels, each a claim with its own preview, laid out from their count.

View as JSON
Count
From Diffkeel › homecertificateOpen the frame

When to use

Use a bento when each claim has its own proof: a script, a prompt, a call. It holds two to four panels under a head, and each panel holds a title, a line and one preview that is a terminal, an agent-prompt or an api-call.

The count lays the panels out; no field sizes them. For claims with no preview, use feature-grid.

Give each panel a claim a reader can check against its own preview, and make every preview different.

Use instead

The record

pages/diffkeel/home.json, section 5
{
  "kind": "section",
  "shell": { "inset": "contained", "density": "section" },
  "block": {
    "type": "bento",
    "head": { "eyebrow": "Where it runs", "title": "Laptop, team, agent." },
    "panels": [
      {
        "title": "On a laptop",
        "text": "Before the pull request.",
        "specimen": {
          "type": "terminal",
          "variant": "plain",
          "title": "zsh · feature/shorter-timeouts",
          "lang": "console",
          "lines": [
            "$ diffkeel diff staging",
            "rendered staging from 2 files in 18 ms",
            "api.yaml     timeout          30s  ->  10s",
            "api.yaml     retries          3    ->  5",
            "1 file, 2 changes, 0 secrets",
            "$ diffkeel render staging --key api.timeout",
            "10s   from staging.yaml, line 12",
            "      over base.yaml, line 4 (30s)",
            "$ diffkeel diff staging --json | wc -l",
            "2"
          ]
        }
      },
      {
        "title": "For the team",
        "text": "Stored diffs and approvals, on Team.",
        "specimen": {
          "type": "api-call",
          "method": "POST",
          "path": "/v1/diffs/{id}/approve",
          "examples": [
            { "label": "Approve", "request": "{ \"env\": \"prod\" }", "status": "200 OK", "response": "{ \"id\": \"df_8k2\", \"approved\": true }" }
          ]
        }
      },
      {
        "title": "In an agent",
        "text": "JSON output an agent reads.",
        "specimen": {
          "type": "agent-prompt",
          "label": "Ask an agent",
          "lines": ["Run diffkeel diff prod --json and explain each change in one line."]
        }
      }
    ]
  }
}

Smallest that parses

{
  "type": "bento",
  "head": { "eyebrow": "Where it runs", "title": "Laptop, team, agent." },
  "panels": [
    {
      "title": "On a laptop",
      "text": "Before the pull request.",
      "specimen": {
        "type": "terminal",
        "variant": "plain",
        "title": "zsh · feature/shorter-timeouts",
        "lang": "console",
        "lines": [
          "$ diffkeel diff staging",
          "rendered staging from 2 files in 18 ms",
          "api.yaml     timeout          30s  ->  10s",
          "api.yaml     retries          3    ->  5",
          "1 file, 2 changes, 0 secrets",
          "$ diffkeel render staging --key api.timeout",
          "10s   from staging.yaml, line 12",
          "      over base.yaml, line 4 (30s)",
          "$ diffkeel diff staging --json | wc -l",
          "2"
        ]
      }
    },
    {
      "title": "For the team",
      "text": "Stored diffs and approvals, on Team.",
      "specimen": {
        "type": "api-call",
        "method": "POST",
        "path": "/v1/diffs/{id}/approve",
        "examples": [
          { "label": "Approve", "request": "{ \"env\": \"prod\" }", "status": "200 OK", "response": "{ \"id\": \"df_8k2\", \"approved\": true }" }
        ]
      }
    },
    {
      "title": "In an agent",
      "text": "JSON output an agent reads.",
      "specimen": {
        "type": "agent-prompt",
        "label": "Ask an agent",
        "lines": ["Run diffkeel diff prod --json and explain each change in one line."]
      }
    }
  ]
}

Fields and bounds

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.

PropType and boundRequired
headobjectyes
head.eyebrowstring ≤28yes
head.titlestring ≤72no
head.ledestring ≤300no
head.maxstring (pattern)no
head.ledeMaxstring (pattern)no
head.balancebooleanno
head.scale"compact" | "large"no
head.tagstring ≤8no
head.layout"split"no
panels2–4 × objectyes
panels[].titlestring ≤48yes
panels[].textstring ≤120no
panels[].specimenSection type (nested)yes

Variants and counts

Three designed counts, 2, 3 and 4, each with its own arrangement.

One record in five Themes

certificateDiffkeel’s ownopen
vaultlineopen
quaypointopen
callboardopen
directoryopen

Shells

paperopen
tintopen
plateopen
glassopen

In three Businesses

Carried by the api-product, article and directory-product Templates. Seen on pages/diffkeel/home.json, section 5.

Diffkeel › home · certificateA developer tool shows the CLI, the CI step and the prompt.
Harbor tides › home · quaypointAn API product shows a script, a prompt and a plotter call.
Ledgerhouse › about · vaultlineA bookkeeping firm shows the two reports a client receives.

Do and do not

Doopen
Each panel holds one of the three preview types.
Don’trefused
{
  "title": "From a shell",
  "text": "One command.",
  "specimen": {
    "type": "command-row",
    "command": "npm i harbor-tides"
  }
}
SectionSchema.safeParse(record)block.panels.1a bento panel holds one specimen: terminal, agent-prompt, api-call
A command row in a panel is refused: a panel holds a terminal, an agent-prompt or an api-call.
Doopen
Each panel proves a different claim.
Don’topen
Three panels showing one call teach one thing three times.

Accessibility

Check, on the exemplar renderLimitNowPass
Skipped heading levels00yes
Unnamed nav landmarks00 of 0yes
Scroll regions a keyboard cannot reach01 of 1no
Copy controls that announce the resultall0 of 1no
Images and icons with no text alternative00yes

Text pairs below AA across the 5 Themes and every scheme they emit: 5. See Render checks.

  • Landmark The bento sits in main. It adds no landmark.
  • Heading level The head title renders as an h2 and each panel title as an h3.
  • Focus order Tab reaches each panel copy control in record order. A window that scrolls sideways takes no focus, and a copy does not announce itself; both are counted above.