Code block
import { CodeBlock } from "@arcadia/ui";src/cache.ts ts
cache-policy.json
CodeBlock
coderequired- string
- The code, without a trailing newline. May grow while
statusis "streaming". language- string
- The language, shown quietly in the head ("tsx").
filename- string
- The file the code is from, shown in the head.
status- "streaming" | "complete"
- Default:
"complete" - "streaming": the head says
Writingon the shared clock and the block is busy. maxLines- number
- The lines it shows before it scrolls; its end stays in view while it is written. Without it the block is as tall as its code.
lineNumbers- boolean
- Line numbers: by default drawn from two lines up.
highlightLines- readonly number[]
- 1-based lines to tint as the line that matters.
copy- boolean
- Default:
true - The copy control: drawn by default.
words- Partial<CodeBlockWords>
- Its words, where a product changes them.
onCopied- (ok: boolean) => void
- Called after every copy with whether it landed.
label- string
- Default:
"Code" - What it holds, for assistive tech ("TypeScript code").
rootStyle- RootStyle<CodeBlockKnobs>
- Typed StyleX override: where the block sits and its
--code-*knobs.
State machine
src/release.ts ts