npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

opentuitui

v0.2.3

Published

Customizable components library built on top of opentui/core

Readme

OpenTUITUI

A customizable components library built on top of opentui/core.

Features

  • TextField: Customizable text input component with:
    • Ctrl+W support for deleting words backward
    • Platform-agnostic paste support (Ctrl+V / Cmd+V)
  • Built for Bun runtime
  • TypeScript with full type definitions
  • Extensible component architecture

Installation

# Using Bun
bun add opentuitui

# Using npm
npm install opentuitui

# Using pnpm  
pnpm add opentuitui

Peer Dependencies

This library requires @opentui/core to be installed:

bun add @opentui/core

Demo

Try out the components in an interactive demo:

bun run demo

This will launch a terminal UI showcasing the TextField component with full interactivity.

Usage

TextField

The TextField component extends InputRenderable from @opentui/core and adds:

  • Ctrl+W: Delete word backward
  • Ctrl+V / Cmd+V: Platform-agnostic paste from system clipboard

The paste functionality works across different platforms:

  • macOS: Uses pbpaste
  • Linux: Supports both Wayland (wl-paste) and X11 (xclip)
  • Windows: Uses PowerShell's Get-Clipboard
import { createCliRenderer, BoxRenderable, TextRenderable } from "@opentui/core";
import { TextField } from "opentuitui";

async function main() {
  const renderer = await createCliRenderer();

  const container = new BoxRenderable(renderer, {
    flexDirection: "column",
    width: 60,
    height: 10,
    border: true,
  });

  const textField = new TextField(renderer, {
    placeholder: "Type something and try Ctrl+W or Ctrl+V...",
    width: 50,
    backgroundColor: "#1f2335",
    focusedBackgroundColor: "#16161e",
    textColor: "#c0caf5",
    cursorColor: "#7aa2f7",
    enableCtrlW: true,
    enablePaste: true,
  });

  textField.on("input", (value) => {
    console.log("Input:", value);
  });

  container.add(textField);
  renderer.root.add(container);
  textField.focus();

  renderer.start();
}

main();

TextField Options

interface TextFieldOptions {
  // All standard InputRenderable options
  placeholder?: string;
  width?: number;
  height?: number;
  backgroundColor?: string;
  focusedBackgroundColor?: string;
  textColor?: string;
  focusedTextColor?: string;
  placeholderColor?: string;
  cursorColor?: string;
  maxLength?: number;
  id?: string;

  // TextField-specific option
  enableCtrlW?: boolean; // default: true
  enablePaste?: boolean; // default: true
}

Events

The TextField component supports all standard InputRenderable events:

textField.on("input", (value) => {
  console.log("Typing:", value);
});

textField.on("change", (value) => {
  console.log("Committed:", value);
});

textField.on("enter", (value) => {
  console.log("Submitted:", value);
});

Keyboard Shortcuts

  • Ctrl+W: Delete word backward (enabled by default)
  • Ctrl+V (Windows/Linux) or Cmd+V (macOS): Paste from system clipboard (enabled by default)
  • All standard InputRenderable shortcuts work as expected

Platform Requirements for Paste

The paste functionality requires platform-specific clipboard utilities:

  • macOS: Built-in pbpaste (no additional installation needed)
  • Linux (Wayland): Install wl-clipboard (sudo apt install wl-clipboard)
  • Linux (X11): Install xclip (sudo apt install xclip)
  • Windows: Built-in PowerShell (no additional installation needed)

Development

# Build the project
bun run build

# Watch mode during development
bun run dev

# Run interactive demo
bun run demo

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT - see LICENSE file for details

Credits

Built on top of OpenTUI - A library for building terminal user interfaces.