accordion
Progressive disclosure of optional detail
interactive 1.0.0 Apache-2.0
Install
docsloth component add @docsloth/accordion@1.0.0 \
--registry https://registry.docsloth.devRun it in a project that has a docsloth.config.json (docsloth init writes one). The docsloth CLI is not on npm yet: it runs from a checkout of the Docsloth engine, and the quickstart shows the setup. Every official component already renders in Docsloth sites; installing one vendors its props schema and specification and pins this exact version and digest.
What the CLI checks
docsloth component add reads this entry from index.json, recomputes the package digest from the manifest and the digest of every file, and writes nothing if one differs.
index.json, lines 7–247 {8 "name": "@docsloth/accordion",9 "version": "1.0.0",10 "kind": "block",11 "description": "Progressive disclosure of optional detail",12 "license": "Apache-2.0",13 "engine": ">=1 <2",14 "publisher": "docsloth",15 "digest": "sha256:320b0d6b28817df96a4f8b3274e151218c9f04c31862d4cd0d895397ee77258e",16 "blocks": [17 "accordion"18 ],19 "capabilities": [20 "render.html"21 ],22 "manifest_path": "packages/@docsloth/accordion/1.0.0/manifest.json",23 "files_base": "packages/@docsloth/accordion/1.0.0/files"24 },Trust signals
- Runtime trust class (catalog)
- interactive. Responds to the reader inside the page, such as switching tabs or filtering, with no network access and no secrets.
- Install trust class
- interactive, derived from the declared
render.html. This is the classdocsloth component addanddocsloth component listreport; it installs under the default policy, with no trust policy. - Package
@docsloth/accordion, version1.0.0- Package digest
sha256:320b0d6b28817df96a4f8b3274e151218c9f04c31862d4cd0d895397ee77258e- Files
- 2 files, each pinned by its own sha256 digest (listed under Package files)
- Capabilities declared
render.html. A declaration, never a grant; every official package declares the same.- Publisher
docsloth, a publisher id rather than a verified identity- Licence
Apache-2.0- Engine range
>=1 <2- Index signature
- Not signed. Digests prove the bytes match the index, not who published them.
- Tools
toggle- Built from
packages/contracts/component-props/accordion.schema.jsonandpackages/contracts/component-specs/accordion.mdin docsloth-registry
Props
The props schema is packages/contracts/component-props/accordion.schema.json; props it does not list are rejected.
| Prop | Type | Required | Notes |
|---|---|---|---|
title | string | no | maxLength: 160 |
open | integer | no |
No prop is required.
Example props generated from the schema
{
"title": "FAQ",
"open": 0
}Preview
Rendered by @docsloth/renderer from the example document block in the specification.
Document block
{
"type": "accordion",
"props": {
"title": "FAQ"
},
"children": [
{
"type": "prose",
"props": {
"label": "How is Markdown generated?",
"text": "The same document IR drives HTML, Markdown and JSON."
}
}
]
}How is Markdown generated?
This is the renderer's real HTML with this registry's styles. Links and controls in the preview are inactive.
Rendered HTML
<div class="ds-accordion" data-component="accordion" aria-label="FAQ">
<details class="ds-accordion-item" open>
<summary class="ds-accordion-summary">
<span class="ds-accordion-marker" aria-hidden="true" data-markdown-ignore="true">▸</span>How is Markdown generated?</summary>
<div class="ds-prose">The same document IR drives HTML, Markdown and JSON.</div>
</details>
</div>Specification
From packages/contracts/component-specs/accordion.md.
Contract
Packaged: this block ships as @docsloth/accordion@1.0.0 — an installable component package (kind block, capability render.html, Apache-2.0) whose production props schema is packages/contracts/component-props/accordion.schema.json and whose catalog entry is in packages/contracts/component-catalog.json. No protocol manifest fixture is published (manifest_fixture: null): the fixture models a packaged protocol runtime this block does not have.
Intended behavior
Progressive disclosure built on <details>/<summary>: every child becomes an item whose label/title/summary is the summary text. All panel content stays in the HTML so no-JS and agent readers see it; Markdown flattens to titled ### subsections with the content directly below.
Failure and fallback
A child without a label/summary degrades the whole block to the labelled fallback block rather than rendering an unlabelled disclosure; empty children and non-array children values do the same. No prop shape throws.
Required acceptance cases
Assert details/summary semantics, the first item open by default, the disclosure marker marked data-markdown-ignore + aria-hidden, ### heading flattening in Markdown and HTML/Markdown visible-text parity. Also test empty data, a child without a summary, unknown extra props, browser without JS, mobile 360px, keyboard navigation, dark mode and an explicit constrained agent tool call. The server independently authorizes capability requests; a package manifest cannot grant authority.
Data and maintenance
Data bindings resolve from a specific publication/release vector and permitted fact/evidence graph. Configuration edits create versioned component patches. Update invalidation uses dependency IDs, never indiscriminate whole-page regeneration. Human-owned props survive automatic updates unless invalidated with an explicit conflict. Missing optional resources leave an honest inert/readable fallback, not a broken page or fake success.
Cost and tools
Pure/local interaction must never invoke a model by accident. Any model, remote query or executor call must reserve approved budget before dispatch. Public visitors do not inherit owner resources. The component may call only named tools in its signed manifest with valid typed inputs. A cancelled job stops polling and closes resources. No component gets platform administration, raw credentials or an unlimited execution loop.
Native renderer block
Block type: accordion. Renderer: packages/renderer/src/index.ts (native, no permission surface).
Native block props
| prop | type | required | behaviour |
|---|---|---|---|
title | string | no | Optional aria-label on the accordion container. |
open | integer | no | Zero-based index of the item open by default (default 0); out-of-range values simply leave the first item open. |
children | DocBlock[] | yes | One disclosure per child; each child needs a non-empty label/title/summary. |
children[].props.open | boolean | no | true forces that item open regardless of open. |
Example
{
"type": "accordion",
"props": { "title": "FAQ" },
"children": [
{
"type": "prose",
"props": {
"label": "How is Markdown generated?",
"text": "The same document IR drives HTML, Markdown and JSON."
}
}
]
}
Markdown:
### How is Markdown generated?
The same document IR drives HTML, Markdown and JSON.
Package files
Served under packages/@docsloth/accordion/1.0.0/. The package digest covers manifest.json, which lists each file with its digest.
| File | sha256 digest | Bytes |
|---|---|---|
props.schema.json | sha256:49453ef46e2cba910f6945e764782188d48af70ad668a9d7e333c4ff9ccdf1cc | 552 |
spec.md | sha256:5af5e4ec63fadbbd13228323bfae9436baca8189377af704efad99fd6bd0abdb | 3518 |
Sources
| Source | Location |
|---|---|
| Markdown twin | https://registry.docsloth.dev/docs/accordion.md |
| JSON metadata | https://registry.docsloth.dev/api/v1/components/accordion.json |
| Specification | packages/contracts/component-specs/accordion.md |
| Props schema | packages/contracts/component-props/accordion.schema.json |
| Catalog | packages/contracts/component-catalog.json |