Skip to content

feat: add TerminalPager component#61

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

feat: add TerminalPager component#61
clawgreen wants to merge 1 commit intoOpenKnots:mainfrom
clawgreen:feat/terminal-pager

Conversation

@clawgreen
Copy link
Copy Markdown
Contributor

What does this PR do?

Adds a new TerminalPager component for navigating through long content (like less or more Unix commands).

Features

  • Keyboard navigation: Space/↓ next, b/↑ back, g first, G last, q quit
  • Progress indicator: Shows percentage and page numbers
  • Flexible input: Accepts string or array of lines
  • Configurable page size: Default 10 lines per page
  • Controls hint: Optional keyboard shortcuts display
  • Color variants: Multiple color options for progress bar
  • onExit callback: Handle pager exit events

Example Usage

<TerminalPager
  content={longLogContent}
  pageSize={15}
  onExit={() => console.log("Pager closed")}
/>

<TerminalPager
  content={["Line 1", "Line 2", ...]}
  variant="cyan"
/>

Type of Change

  • 📦 New component
  • ✨ Enhancement (playground example)

Checklist

  • Component created in components/terminal-pager.tsx
  • TypeScript interface with JSDoc
  • Exported from components/terminal.tsx
  • Playground example with log content
  • Keyboard navigation implemented
  • Build passes (pnpm run build)
  • Follows project patterns
  • Zero new dependencies

Screenshots

See playground at /playground for live example with paginated log output.


Part of NEW_COMPONENTS_PLAN.md (Phase 2)

- Navigate through long content like less/more commands
- Keyboard controls (Space/↓ next, b/↑ back, g first, G last, q quit)
- Progress indicator showing percentage and page numbers
- Configurable page size
- Optional controls hint display
- 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