Composition example
Execution output · Terminal, file, diff, and search
Preview
Code
render: () => (
<Stack>
<TerminalBlock
command="bun test"
cwd="meowland"
exitCode={0}
output={
"\u001b[32mPASS\u001b[0m renderer\n" +
Array.from({ length: 24 }, (_, i) => `case ${i + 1}: passed`).join("\n")
}
/>
<ReadBlock
label="src/main.ts"
totalLines={120}
lines={Array.from({ length: 24 }, (_, i) => ({
number: i + 41,
text: `const item${i} = ${i};`,
highlighted: i === 2,
}))}
/>
<DiffBlock
files={[
{
path: "theme.ts",
lines: [
{ kind: "context", text: "export const theme = {" },
{ kind: "removed", text: " radius: 8," },
{ kind: "added", text: " radius: 16," },
{ kind: "context", text: "};" },
],
},
]}
/>
<SearchBlock
kind="matches"
total={20}
truncated
files={[
{ path: "src/theme.ts", matches: [{ lineNumber: 12, line: "export const theme = {};" }] },
{
path: "src/main.ts",
matches: [{ lineNumber: 4, line: "import { theme } from './theme';" }],
},
]}
/>
</Stack>
)