kbd
Keyboard shortcut chord
pure 1.0.0 Apache-2.0
Install
docsloth component add @docsloth/kbd@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 493–510493 {494 "name": "@docsloth/kbd",495 "version": "1.0.0",496 "kind": "block",497 "description": "Keyboard shortcut chord",498 "license": "Apache-2.0",499 "engine": ">=1 <2",500 "publisher": "docsloth",501 "digest": "sha256:e8a75f9817fa29cbf8e308381c4563f74c74fbbb87c27ab99b98af053bcac83f",502 "blocks": [503 "kbd"504 ],505 "capabilities": [506 "render.html"507 ],508 "manifest_path": "packages/@docsloth/kbd/1.0.0/manifest.json",509 "files_base": "packages/@docsloth/kbd/1.0.0/files"510 },Trust signals
- Runtime trust class (catalog)
- pure. Renders content only: no side effects, no network access and no permission prompts.
- 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/kbd, version1.0.0- Package digest
sha256:e8a75f9817fa29cbf8e308381c4563f74c74fbbb87c27ab99b98af053bcac83f- 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
- none
- Built from
packages/contracts/component-props/kbd.schema.jsonandpackages/contracts/component-specs/kbd.mdin docsloth-registry
Props
The props schema is packages/contracts/component-props/kbd.schema.json; props it does not list are rejected.
| Prop | Type | Required | Notes |
|---|---|---|---|
keys | string | array<string> | no | A shortcut chord; an array is joined with "+". |
text | string | no | Alias for keys.; maxLength: 64 |
No prop is required.
Example props generated from the schema
{
"keys": [
"Ctrl",
"K"
],
"text": "example-text"
}Preview
Rendered by @docsloth/renderer from the example document block in the specification.
Document block
{
"type": "kbd",
"props": {
"keys": [
"Ctrl",
"K"
]
}
}This is the renderer's real HTML with this registry's styles. Links and controls in the preview are inactive.
Rendered HTML
<kbd class="ds-kbd" data-component="kbd">Ctrl+K</kbd>Specification
From packages/contracts/component-specs/kbd.md.
Contract
Packaged: this block ships as @docsloth/kbd@1.0.0 — an installable component package (kind block, capability render.html, Apache-2.0) whose production props schema is packages/contracts/component-props/kbd.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
Keyboard shortcut: renders a semantic <kbd> element whose text is the chord. keys accepts a string ("Ctrl+K") or an array of keys joined with + (["Ctrl","K"]). Markdown renders the same chord in backticks (` Ctrl+K `), and JSON keeps the raw props.
Failure and fallback
Missing keys, an empty key array, or non-string entries in the array degrade to the labelled fallback block instead of rendering an empty or half-rendered key cap. No prop shape throws.
Required acceptance cases
Assert <kbd> semantics, + joining for key arrays, backtick Markdown, escaping of hostile key text, and HTML/Markdown visible-text parity. Also test a missing keys prop, an empty array, unknown extra props, mobile 360px, 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: kbd. Renderer: packages/renderer/src/index.ts (native, no permission surface).
Native block props
| prop | type | required | behaviour |
|---|---|---|---|
keys | string | string[] | yes | Shortcut chord; an array is joined with +. text is accepted as an alias. |
text | string | conditional | Alias for keys when keys is absent. |
Example
{ "type": "kbd", "props": { "keys": ["Ctrl", "K"] } }
HTML: <kbd class="ds-kbd">Ctrl+K</kbd>. Markdown: ` Ctrl+K `.
Package files
Served under packages/@docsloth/kbd/1.0.0/. The package digest covers manifest.json, which lists each file with its digest.
| File | sha256 digest | Bytes |
|---|---|---|
props.schema.json | sha256:239eeb972cb95a8c24e39da15cacbec846bdcd129a4008741ee79c82f4b0cfb0 | 1061 |
spec.md | sha256:57393c11a27d8d69ff88a773079199d261406a727ac647d5c3400e77d0c795ad | 2836 |
Sources
| Source | Location |
|---|---|
| Markdown twin | https://registry.docsloth.dev/docs/kbd.md |
| JSON metadata | https://registry.docsloth.dev/api/v1/components/kbd.json |
| Specification | packages/contracts/component-specs/kbd.md |
| Props schema | packages/contracts/component-props/kbd.schema.json |
| Catalog | packages/contracts/component-catalog.json |