CodeBlock
Read-only code or log output with a built-in copy button. Never renders markup — text is shown verbatim.
rendered, live
the wire — click a line to scrub
the contract — CodeBlock in catalog.json
{
"type": "object",
"description": "Read-only code or log output with a built-in copy button. Never renders markup — text is shown verbatim.",
"properties": {
"component": {
"const": "CodeBlock"
},
"code": {
"$ref": "https://a2ui.org/specification/v1_0/common_types.json#/$defs/DynamicString",
"description": "The code or log text, verbatim. Bind with {\"path\": ...} to stream a growing log."
},
"language": {
"type": "string",
"description": "Syntax-highlighting hint, e.g. 'json', 'bash', 'log'. Free-form; the renderer highlights best-effort."
},
"wrap": {
"type": "boolean",
"default": false,
"description": "Soft-wrap long lines instead of horizontal scrolling."
},
"label": {
"$ref": "https://a2ui.org/specification/v1_0/common_types.json#/$defs/DynamicString",
"description": "Optional caption, e.g. a filename or 'deploy log'."
}
},
"required": [
"component",
"code"
]
}the prompt-pack — paste into your agent
### CodeBlock — read-only code or log output
Text renders verbatim (never as markup), with a built-in copy button. Bind `code` to stream a
growing log.
| prop | type | required | notes |
| ---------- | ------- | -------- | --------------------------------------------- |
| `code` | string | yes | the text; bind with `{"path"}` for live logs |
| `language` | string | no | highlight hint: `"json"`, `"bash"`, `"log"` … |
| `wrap` | boolean | no | soft-wrap long lines; default `false` |
| `label` | string | no | caption, e.g. a filename |
```
{"id":"log_tail","component":"CodeBlock","label":"deploy log","language":"log","code":{"path":"/logTail"}}
```