UI componentsdocs/ui/components/developer.md

Code & developer

Code, keyboard shortcuts, logs, JSON, APIs and delivery pipelines.

← Component reference

Code #

Inline code and highlighted blocks.

Code #

Inline code.

Run bun run ui:docs after changing an example.

<Text>
    Run <Code>bun run ui:docs</Code> after changing an example.
</Text>
PropTypeRequiredDefaultDescription
childrencontentInline code.

CodeBlock #

Highlighted code with copy button.

tsx
import { Button } from "@arachnejs/ui";

export const Save = () => <Button>Save</Button>;
<CodeBlock
    language="tsx"
    radius="lg"
    code={
        'import { Button } from "@arachnejs/ui";\n\nexport const Save = () => <Button>Save</Button>;'
    }
/>

Slots: root bar code copy language pre

PropTypeRequiredDefaultDescription
codestringyesSource code to highlight and copy.
copiedLabelstring"Copied"Copy button text shown briefly after copying.
copyLabelstring"Copy"Copy button text.
languagestring"tsx"Language for highlighting, shown in the header.
radius(string & {}) | RadiusNameCorner radius: "none" | "sm" | "lg" or any CSS length (default: the theme radius).

RadiusName — Corner radius scale — sm is the kit default.

type RadiusName = "none" | "sm" | "lg";

Diff #

Unified diff lines.

<Title  size={5}  order={3} size={5}>Settings</Title>
<Diff
    lines={[
        { type: "ctx", text: "<Title" },
        { type: "del", text: "  size={5}" },
        { type: "add", text: "  order={3} size={5}" },
        { type: "ctx", text: ">Settings</Title>" },
    ]}
/>

Slots: root line prefix

PropTypeRequiredDefaultDescription
linesDiffLine[]yesDiff lines, in order.

DiffLine

FieldTypeRequiredDescription
type"add" | "del" | "ctx"yesadd, del or ctx (unchanged context).
textstringyesThe line's text (without the + / - prefix).

Also accepts the shared props: pass-through attributes, class, style, classes, styles, unstyled.

Keyboard #

Keys and shortcuts.

Kbd #

Keyboard key.

Press Esc to close.

<Text>
    Press <Kbd>Esc</Kbd> to close.
</Text>
PropTypeRequiredDefaultDescription
childrencontentKey or key combination text, e.g. ⌘K.

Hotkey #

Display a key combo (⌘K, Ctrl+S).

⌘K
<Hotkey keys={["⌘", "K"]} />

Slots: root key part separator

PropTypeRequiredDefaultDescription
keysstring[]yesKeys to show and (with onTrigger) listen for, e.g. ["Ctrl", "K"] or ["⌘", "Shift", "P"].
ignoreInInputsbooleanIgnore the shortcut while typing in inputs (default true).
onTrigger(e: KeyboardEvent) => voidBind the combination on document; called when it is pressed (default prevented).
separatorcontent"+"Separator between keys (default +).

Also accepts the shared props: pass-through attributes, class, style, classes, styles, unstyled.

Terminal & logs #

Command output and log streams.

Terminal #

Terminal window mock-up.

zsh
$ bun add @arachnejs/ui
installed @arachnejs/[email protected]
<Terminal title="zsh">
    {"$ bun add @arachnejs/ui\ninstalled @arachnejs/[email protected]"}
</Terminal>

Slots: root bar body title

PropTypeRequiredDefaultDescription
childrencontentTerminal text (newlines are kept).
titlestring"Terminal"Window title in the header bar.

LogViewer #

Monospace log output with levels and timestamps.

12:04:01INFOListening on :300012:04:07WARNSlow query (812 ms): SELECT * FROM runs12:04:09ERRORECONNRESET redis://cache:6379
<LogViewer
    lines={[
        { time: "12:04:01", level: "info", message: "Listening on :3000" },
        { time: "12:04:07", level: "warn", message: "Slow query (812 ms): SELECT * FROM runs" },
        { time: "12:04:09", level: "error", message: "ECONNRESET redis://cache:6379" },
    ]}
/>

Slots: root level line message time

PropTypeRequiredDefaultDescription
linesLogLineData[]yesLog lines, oldest first.

LogLineData

FieldTypeRequiredDescription
timestringTimestamp text.
levelLogLevelyesSeverity; sets the colour.
messagestringyesLog message.

LogLevel

type LogLevel = "debug" | "info" | "warn" | "error";

Also accepts the shared props: pass-through attributes, class, style, classes, styles, unstyled.

JSON #

Read-only JSON views.

JsonViewer #

Pretty-printed JSON (handles undefined, circular references and BigInt).

{
  "id": "dep_128",
  "status": "ready",
  "regions": [
    "fra1",
    "iad1"
  ]
}
<JsonViewer value={{ id: "dep_128", status: "ready", regions: ["fra1", "iad1"] }} />
PropTypeRequiredDefaultDescription
valuecontentyesAny JSON-serializable value to show, pretty-printed.

JsonTree #

Collapsible JSON tree.

name: "arachne"
private: true
0: "packages/*"
1: "apps/*"
const configJson: JsonNode = {
    kind: "object",
    entries: [
        { key: "name", value: { kind: "primitive", value: "arachne" } },
        { key: "private", value: { kind: "primitive", value: true } },
        {
            key: "workspaces",
            value: {
                kind: "array",
                items: [
                    { kind: "primitive", value: "packages/*" },
                    { kind: "primitive", value: "apps/*" },
                ],
            },
        },
    ],
};

<JsonTree data={configJson} />
PropTypeRequiredDefaultDescription
dataJsonNodeyesThe JSON tree to show; objects and arrays can be collapsed.

JsonNode

type JsonNode = | { kind: "primitive"; value: string | number | boolean | null } | { kind: "object"; entries: Array<{ key: string; value: JsonNode }> } | { kind: "array"; items: JsonNode[] };

Also accepts the shared props: pass-through attributes, class, style, classes, styles, unstyled.

FileTree #

File / folder tree. Rows expose data-kind.

Open: src/button.tsx

const repoTree: FileTreeNode[] = [
    {
        id: "src",
        name: "src",
        kind: "folder",
        children: [
            { id: "src/index.ts", name: "index.ts", kind: "file" },
            { id: "src/button.tsx", name: "button.tsx", kind: "file" },
        ],
    },
    { id: "package.json", name: "package.json", kind: "file" },
];

function Example() {
    const file = signal("src/button.tsx");
    return (
        <Stack gap="0.5rem">
            <FileTree label="Repository" nodes={repoTree} selected={file()} onSelect={file.set} />
            <Text muted>Open: {file()}</Text>
        </Stack>
    );
}
PropTypeRequiredDefaultDescription
nodesFileTreeNode[]yesRoot files and folders.
labelstring"Files"Accessible name for the tree.
onSelect(id: string) => voidCalled with the id of the file the user picks.
selectedstringId of the selected file.

FileTreeNode

FieldTypeRequiredDescription
idstringyesNode id, passed to onSelect and matched against selected.
namestringyesFile or folder name.
kind"file" | "folder"yesfile or folder (sets the icon; folders expand).
childrenFileTreeNode[]Contents of a folder.

Also accepts the shared props: pass-through attributes, class, style, classes, styles, unstyled.

API endpoints #

HTTP methods and endpoint rows.

EndpointRow #

API endpoint row: method, path and summary.

Interact with the example: callbacks show up here.
<EndpointRow
    method="POST"
    path="/v1/projects/{id}/deploys"
    summary="Start a deploy"
    onClick={() => {}}
/>

Slots: root path summary

PropTypeRequiredDefaultDescription
methodHttpMethodyesHTTP method.
pathstringyesEndpoint path, e.g. /v1/projects/{id}.
onClick() => voidMakes the row a button, e.g. to open the endpoint's docs.
summarystringWhat the endpoint does.

HttpMethod

type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS";

HttpMethodBadge #

Coloured HTTP method label (GET, POST, …).

DELETE
<HttpMethodBadge method="DELETE" />
PropTypeRequiredDefaultDescription
methodHttpMethodyesHTTP method; sets the colour.

HttpMethod

type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD" | "OPTIONS";

Also accepts the shared props: pass-through attributes, class, style, classes, styles, unstyled.

Builds & git #

Pipelines, build status, commits and branches.

Pipeline #

CI pipeline of steps with their statuses.

  1. Install
  2. Test
  3. Build
  4. Deploy
<Pipeline
    steps={[
        { id: "install", label: "Install", status: "success" },
        { id: "test", label: "Test", status: "success" },
        { id: "build", label: "Build", status: "running" },
        { id: "deploy", label: "Deploy", status: "queued" },
    ]}
/>

Slots: root line step

PropTypeRequiredDefaultDescription
stepsPipelineStep[]yesPipeline steps, in order.

PipelineStep

FieldTypeRequiredDescription
idstringyesStep id.
labelstringyesStep name.
statusBuildStatusKindyesStep state; sets the icon and colour.

BuildStatusKind

type BuildStatusKind = "success" | "failed" | "running" | "queued" | "cancelled";

BuildStatus #

CI build status (running, success, failed …).

running
<BuildStatus status="running" />
PropTypeRequiredDefaultDescription
statusBuildStatusKindyesBuild state; sets the icon and colour.
labelstringCustom text instead of the status name.

BuildStatusKind

type BuildStatusKind = "success" | "failed" | "running" | "queued" | "cancelled";

CommitChip #

Commit SHA and message chip.

Interact with the example: callbacks show up here.
<CommitChip
    sha="3f9c2e7a41d0b8"
    message="Fix toast focus"
    onClick={() => {}}
/>

Slots: root message sha

PropTypeRequiredDefaultDescription
shastringyesFull commit hash (the first 7 characters are shown).
messagestringCommit message, shown after the hash.
onClick() => voidMakes the chip a button, e.g. to open the commit.

BranchBadge #

Git branch name label.

feat/ui-kit
<BranchBadge name="feat/ui-kit" />
PropTypeRequiredDefaultDescription
namestringyesBranch name.

Also accepts the shared props: pass-through attributes, class, style, classes, styles, unstyled.

Status & changelog #

Service status and release notes.

ServiceStatus #

Service name with its operational status.

Build workersdegraded
<ServiceStatus name="Build workers" status="degraded" />

Slots: root name status

PropTypeRequiredDefaultDescription
namestringyesService name.
statusServiceStatusKindyesCurrent state; sets the dot colour and text.

ServiceStatusKind

type ServiceStatusKind = "operational" | "degraded" | "outage" | "maintenance";

ChangelogItem #

One release entry in a changelog.

v2.4.0
Tables gain sticky headers and keyboard row selection.
<ChangelogItem version="2.4.0" date="Sep 12, 2026">
    Tables gain sticky headers and keyboard row selection.
</ChangelogItem>

Slots: root body date header title

PropTypeRequiredDefaultDescription
versionstringyesRelease version, e.g. 2.4.0.
childrencontentWhat changed.
datestringRelease date text.
titlestringRelease name.

Also accepts the shared props: pass-through attributes, class, style, classes, styles, unstyled.