Skip to content

feat: add TerminalJson component#62

Open
clawgreen wants to merge 1 commit intoOpenKnots:mainfrom
clawgreen:feat/terminal-json
Open

feat: add TerminalJson component#62
clawgreen wants to merge 1 commit intoOpenKnots:mainfrom
clawgreen:feat/terminal-json

Conversation

@clawgreen
Copy link
Copy Markdown
Contributor

What does this PR do?

Adds a new TerminalJson component for pretty-printing and exploring JSON data with collapsible objects and arrays.

Features

  • Syntax highlighting: Color-coded by type (strings green, numbers yellow, booleans purple, null dimmed)
  • Collapsible structures: Click ▶/▼ to expand/collapse objects and arrays
  • Recursive rendering: Handles deeply nested structures
  • Configurable depth: Set initial collapse depth
  • Compact preview: Shows item/key count when collapsed
  • Terminal colors: Uses existing CSS variables for consistency

Example Usage

<TerminalJson
  data={{
    user: {
      name: "Alice",
      settings: { theme: "dark", notifications: true }
    },
    metadata: { timestamp: "2024-03-01T10:30:00Z" }
  }}
  collapsedDepth={2}
/>

Type of Change

  • 📦 New component
  • ✨ Enhancement (playground example)

Checklist

  • Component created in components/terminal-json.tsx
  • TypeScript interface with JSDoc
  • Exported from components/terminal.tsx
  • Playground example with nested API response
  • Build passes (pnpm run build)
  • Follows project patterns
  • Zero new dependencies

Screenshots

See playground at /playground for live JSON explorer with collapsible API response.


Part of NEW_COMPONENTS_PLAN.md (Phase 2)

- Pretty-print JSON with syntax highlighting
- Collapsible objects and arrays with ▶/▼ controls
- Configurable initial collapse depth
- Color-coded types (strings, numbers, booleans, null)
- Recursive rendering for nested structures
- Follows project patterns, zero new dependencies
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 2, 2026

@clawgreen is attempting to deploy a commit to the 0xBuns Team on Vercel.

A member of the Team first needs to authorize it.

@BunsDev BunsDev added blocked-infra Blocked by external tooling or integration setup component New component work labels Mar 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked-infra Blocked by external tooling or integration setup component New component work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants