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

@termuijs/widgets

v0.1.6

Published

Box, Text, Table, ProgressBar, Spinner, Gauge, VirtualList, and more for TermUI

Readme

@termuijs/widgets

The building blocks for terminal UIs. Display, layout, data, charts, and feedback widgets. Every widget extends the base Widget class, manages its own render rectangle, and only repaints when something changes.

Install

npm install @termuijs/widgets

Requires @termuijs/core as a peer dependency.

All widgets

Display

| Widget | What it does | |--------|-------------| | Box | Container with flexbox layout, borders, padding, margin | | Text | Styled text. Color, bold, italic, underline, strikethrough, dim | | LogView | Scrollable log panel with auto-scroll and configurable buffer | | StreamingText | Typewriter effect. Respects NO_MOTION for instant output | | ChatMessage | Chat bubble with role-aware styling (user / assistant / system) | | ToolCall | AI tool call display with status indicator and collapsible args | | JSONView | Collapsible, navigable JSON tree viewer | | DiffView | Unified diff viewer with colored add / remove lines | | BigText | Large ASCII art banner text. No external dependencies | | Gradient | Text with per-character 256-color gradient |

Layout

| Widget | What it does | |--------|-------------| | Card | Bordered container with optional title in the border | | ScrollView | Height-bounded scrollable container with arrow-key navigation | | Center | Centers a single child horizontally, vertically, or both | | Columns | Evenly-split column layout from an array of widgets | | Sidebar | Navigable sidebar with items, badges, and active highlight | | KeyValue | Aligned key: value pairs with configurable separator | | Definition | Term (bold) and definition (normal) stacked pairs | | Banner | Full-width alert with title, body, and variant color | | StatusMessage | Compact icon and message with variant color | | Grid | CSS-grid-style layout; items flow left-to-right and wrap every N columns |

Data and charts

| Widget | What it does | |--------|-------------| | Table | Data table with headers, column alignment, row selection | | Gauge | Percentage indicator with label and color thresholds | | Sparkline | Inline bar chart from an array of numbers | | BarChart | Horizontal or vertical bar chart with grouping | | LineChart | ASCII line plot with labeled X/Y axes and multi-series support | | HeatMap | 2D matrix with color-scale shading and row/col labels | | StatusIndicator | Colored dot with a label (ok / warn / error / unknown) |

Feedback

| Widget | What it does | |--------|-------------| | ProgressBar | Horizontal bar with percentage fill and optional label | | Spinner | Animated loading indicator. Static char when NO_MOTION=1 | | Skeleton | Animated loading placeholder (pulse or shimmer) | | MultiProgress | Multiple labeled progress bars in one widget | | CommandPalette | Searchable, filterable command menu | | Scrollbar | Standalone scrollbar indicator (vertical or horizontal) |

Input

| Widget | What it does | |--------|-------------| | TextInput | Single-line text input with cursor, placeholder, and change callback | | List | Scrollable list with keyboard selection. Good for small datasets | | VirtualList | Scroll-virtualized list. Renders only visible rows; 1M items costs the same as 10 |

Usage

import { Box, Text, ProgressBar, StreamingText } from '@termuijs/widgets'

const container = new Box({
    flexDirection: 'column',
    border: 'rounded',
    padding: 1,
})

container.addChild(new Text({ content: 'Downloads', bold: true }))
container.addChild(new ProgressBar({ value: 0.73, width: 30 }))
container.addChild(new StreamingText({ text: 'Processing...', speed: 40 }))

VirtualList

VirtualList paints only the rows that fit in the viewport plus a small overscan buffer. A list of 1,000,000 items renders the same ~26 rows as a list of 10.

const list = new VirtualList({
    totalItems: 1_000_000,
    renderItem: (index) => `Line ${index}: some content`,
    onSelect: (index) => inspect(index),
})

list.selectNext()
list.selectPrev()
list.pageDown()
list.selectFirst()
list.selectLast()
list.scrollTo(500)

AI widgets

Display AI tool usage and streaming output with the purpose-built widgets:

import { StreamingText, ChatMessage, ToolCall } from '@termuijs/widgets'

const msg = new ChatMessage({
    role: 'assistant',
    content: 'Here is the result...',
})

const call = new ToolCall({
    name: 'read_file',
    status: 'running',
    args: { path: '/etc/hosts' },
})

const stream = new StreamingText({
    text: 'Generating response...',
    speed: 30,
    cursor: '▋',
})

caps.unicode and caps.motion

All widgets check caps.unicode and caps.motion automatically. Set NO_UNICODE=1 or NO_MOTION=1 in your environment to get ASCII fallbacks and static output. This works across Spinner, Skeleton, StreamingText, ProgressBar, LineChart, HeatMap, and every other widget that uses unicode characters or timers.

Documentation

Full docs at www.termui.io/docs/widgets/overview.

License

MIT