versioned-content
Version-scoped content region
| Field | Value |
|---|---|
| Trust class | pure |
| Implementation status | implemented_native |
| Renderer | native block |
| Key prop (production schema) | version |
| Key prop (protocol fixture) | no protocol fixture published |
| Tools | none |
| Package version | 1.0.0 |
| Package digest | sha256:1e23f883a5debc8a859214dc206755936b9b9541f764618c5c1c7aea4ac88d9c |
Install
docsloth component add @docsloth/versioned-content@1.0.0
Live package: sha256:1e23f883a5debc8a859214dc206755936b9b9541f764618c5c1c7aea4ac88d9c with 2 file digest(s); the catalog entry is generated from the built package, not a placeholder.
Props
The prop schema is normative in packages/contracts/component-props/versioned-content.schema.json.
| Prop | Type | Required | Constraints |
|---|---|---|---|
version | string | number | yes | |
label | string | no | maxLength: 200 |
content | string | no | maxLength: 20000 |
Example props generated from this schema:
{
"version": "2.0",
"label": "Applies to v2",
"content": "Use the v2 client."
}
Required props: version.
Example
Example document IR (the block the renderer consumes):
{
"type": "versioned-content",
"props": {
"version": "2.0",
"label": "Applies to v2",
"content": "Use the v2 client."
}
}
Renderer HTML (entities decoded and wrapped for display):
<section class="ds-versioned" data-component="versioned-content" data-version="2.0" aria-label="Applies to v2, version 2.0">
<p class="ds-version-label">Version 2.0</p>
<div class="ds-version-content">Use the v2 client.</div>
</section>
Preview (interface-only; the markup above is the same output):
Version 2.0
The renderer resolves this component as a native block; the preview above is its real HTML output, and Markdown parity for native blocks is covered by the renderer test suite.
Specification
Generated from packages/contracts/component-specs/versioned-content.md.
Contract
Packaged: this block ships as @docsloth/versioned-content@1.0.0 — an installable component package (kind block, capability render.html, Apache-2.0) whose production props schema is packages/contracts/component-props/versioned-content.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
Scope content to a product or API version with an explicit visible label. The AI-native rule is stronger than for visual chrome: Markdown must never hide content, so the version is carried as a > Version: <version> blockquote followed by the full body regardless of which version a host page chooses to display.
Failure and fallback
A missing/empty version, or a body that has neither non-empty content nor child blocks, degrades the block to the labelled fallback. A non-string label is ignored (the version text remains). Content is never dropped: the fallback and the Markdown twin both keep the body.
Required acceptance cases
A version-scoped block must not silently disappear from the Markdown twin or the JSON view, and switching versions must not change content meaning. Also test empty data, loading, denied access, 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
packages/renderer renders a versioned-content block as a <section data-version="…"> with a visible Version <version> label and an accessible region name. props.label joins the accessible name (aria-label) rather than replacing the visible version text, so HTML and Markdown always expose the same version tokens. Markdown emits > Version: <version> followed by the content, and children stay visible after it.
Native block props
| prop | type | required | behaviour |
|---|---|---|---|
version | string | number | yes | Visible version value, also written to data-version. Empty/non-finite values degrade to the fallback. |
label | string | no | Accessible region name (e.g. "Applies to v2"); it does not replace the visible version. |
content | string | no | Body text rendered as a paragraph; escaped in HTML, never hidden in Markdown. |
children | DocBlock[] | no | Additional body blocks; the block needs content or at least one child. |
Example
{
"type": "versioned-content",
"props": { "version": "2.0", "label": "Applies to v2", "content": "Use the v2 client." }
}
Package manifest
No protocol fixture is published for this renderer-native block.
| Field | Value |
|---|---|
| Fixture | none published |
Sources
| Source | Path |
|---|---|
| Component page | https://registry.docsloth.dev/components/versioned-content.html |
| Markdown twin | https://registry.docsloth.dev/docs/versioned-content.md |
| LLM index | https://registry.docsloth.dev/llms.txt |
| Specification | packages/contracts/component-specs/versioned-content.md |
| Prop schema | packages/contracts/component-props/versioned-content.schema.json |
| Catalog | packages/contracts/component-catalog.json |