@mohndoe/pi-tui-extras
v0.1.6
Published
Pi.dev component library.
Readme
Customizable, well-tested and easy to use components and utilities for pi.dev extensions development.
Install
bun add @mohndoe/pi-tui-extras
npm install @mohndoe/pi-tui-extras
pnpm add @mohndoe/pi-tui-extras
yarn add @mohndoe/pi-tui-extrasDemo
Try the components live in your terminal:
bun run demoNavigate with ↑↓ and Enter to tweak component props in real time. Press Tab to switch between pages (more coming), and q to quit.
For hot-reload during development:
bun run demo:watchThis watches src/ and demo/ for changes and restarts the TUI automatically.
Components
- BorderBox -- Bordered container with configurable style, titles, footers, and padding.
- ~~Table~~ (coming soon)
- ~~FlexLayout~~ (coming soon)
- ~~Scrollbar~~ (coming soon)
See all components here.
Core utilities
truncate-- Fit string to a maximum visible width, appending "…".padLine-- Right-pad a string with spaces to reach a target width.alignInWidth-- Left, center, or right-align text within a fixed width.alignInWidthLR-- Position two strings at opposite ends of a fixed width.
See all all utilities here.
Project status
Early development. BorderBox is stable and tested. More components coming, including: tables, flex layout, scrollbar, etc.
Contributing
This project follows the conventions in CONTEXT.md and AGENTS.md. Tests are co-located (*.test.ts next to source) and use vitest.
- Branch from
maininto afeat/orfix/prefix - Write tests before implementation (TDD)
- Run
bun testbefore opening a PR - Open a PR
License
MIT — see LICENSE.
