@boba-cli/code
v0.1.0-alpha.3
Published
Syntax-highlighted code viewer with scrollable viewport for Boba terminal UIs
Readme
@boba-cli/code
Syntax-highlighted code viewer component for Boba terminal UIs.

Features
- Syntax highlighting with configurable themes
- Scrollable viewport for long code files
- Supports multiple programming languages via file extension detection
- Async file loading
- Keyboard navigation when active
Installation
pnpm add @boba-cli/codeUsage
import { CodeModel } from '@boba-cli/code'
import { Program } from '@boba-cli/tea'
const codeModel = CodeModel.new({ active: true })
// In init
const cmd = codeModel.setFileName('example.ts')
// In update - handle window resize
if (msg instanceof WindowSizeMsg) {
codeModel = codeModel.setSize(msg.width, msg.height)
}
// In view
return codeModel.view()API
See API documentation for details.
