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

@byteland/ink-scroll-bar

v0.1.1

Published

A vertical ScrollBar component for Ink CLI applications

Readme

📜 ink-scroll-bar

A customizable, high-precision vertical scroll bar component for Ink CLI applications.

License Version

✨ Features

  • Two Rendering Modes:

    • Border Mode: Seamlessly integrates with container borders (replaces one side).

      Border Mode Demo

    • Inset Mode: Renders inside the content area, perfect for floating scroll bars.

      Inset Mode Demo

      • Supports autoHide: Completely hide the scroll bar when content fits the viewport.
      • If autoHide is false (default) and content fits, only the track is shown.

      Auto Hide Demo

  • Rich Styling:

    • Supports all standard Ink border styles (single, double, round, bold, etc.).
    • Special inset styles (block, line, thick, dots).
    • Customizable colors and dimming.
  • Flexible Integration:

    • Standalone ScrollBar component for custom layouts.
    • ScrollBarBox wrapper for instant bordered containers with scroll bars.
  • Auto-hide: Option to hide the scroll bar when content fits the viewport (inset mode).

📦 Installation

npm install ink-scroll-bar

🚀 Usage

Basic Usage with ScrollBarBox

The easiest way to use ink-scroll-bar is with the ScrollBarBox component. It wraps your content in a bordered box and handles the scroll bar positioning for you.

import React, { useState } from "react";
import { Text } from "ink";
import { ScrollBarBox } from "ink-scroll-bar";

const MyComponent = () => {
  const [offset, setOffset] = useState(0);
  const totalItems = 50;
  const viewportHeight = 10;

  return (
    <ScrollBarBox
      height={viewportHeight + 2} // +2 for borders
      width={40}
      borderStyle="single"
      scrollBarPosition="right"
      contentHeight={totalItems}
      viewportHeight={viewportHeight}
      scrollOffset={offset}
    >
      {/* Your scrollable content here */}
      <Text>Item 1...</Text>
    </ScrollBarBox>
  );
};

Advanced Usage with ScrollBar

For more control over layout, use the standalone ScrollBar component.

Border Mode

In border mode, the scroll bar renders corner characters to connect with adjacent borders.

import { Box } from "ink";
import { ScrollBar } from "ink-scroll-bar";

<Box flexDirection="row">
  {/* Content Box with right border removed */}
  <Box borderStyle="single" borderRight={false}>
    <Content />
  </Box>

  {/* ScrollBar completes the border */}
  <ScrollBar
    placement="right"
    style="single"
    contentHeight={100}
    viewportHeight={20}
    scrollOffset={offset}
  />
</Box>;

Inset Mode

Inset mode renders without corners, suitable for placing inside a container.

<Box borderStyle="round" padding={1}>
  <Box flexDirection="row">
    <Content />
    <ScrollBar
      placement="inset"
      style="block" // 'block', 'line', 'thick', 'dots'
      color="cyan"
      contentHeight={100}
      viewportHeight={20}
      scrollOffset={offset}
      autoHide // Hide if content fits
    />
  </Box>
</Box>

📚 API

ScrollBar Props

| Prop | Type | Default | Description | | ---------------- | ------------------------------ | -------------------- | ------------------------------------------------------------------------------------- | | contentHeight | number | Required | 📏 Total height of the scrollable content. | | Prop | Type | Default | Description | | ---------------- | ------------------------------ | -------------------- | --------------------------------------------------------------------------- | | contentHeight | number | Required | 📏 Total height of the scrollable content. | | viewportHeight | number | Required | 👁️ Height of the visible area. | | scrollOffset | number | Required | ⬇️ Current scroll position (0 to max). | | placement | 'left' \| 'right' \| 'inset' | 'right' | 📍 Rendering mode/position. | | style | ScrollBarStyle | 'single'/'block' | 🎨 Visual style (see below). | | color | string | undefined | 🌈 Color of the scroll bar characters. | | dimColor | boolean | false | 🌑 Whether to dim the scroll bar. | | autoHide | boolean | false | 👻 Hide when content fits (Inset mode only). If false, shows track when content fits. | | thumbChar | string | - | 👍 Custom thumb character (Inset mode only). | | trackChar | string | - | 🛤️ Custom track character (Inset mode only). |

ScrollBarBox Props

Inherits all Ink Box Props, plus:

| Prop | Type | Default | Description | | ------------------- | ------------------- | ------------ | ------------------------------------------- | | contentHeight | number | Required | 📏 Total height of the content. | | viewportHeight | number | Required | 👁️ Height of the viewport. | | scrollOffset | number | Required | ⬇️ Current scroll position. | | scrollBarPosition | 'left' \| 'right' | 'right' | 📍 Which border to replace with scroll bar. | | scrollBarAutoHide | boolean | false | 👻 Hide thumb if content fits. |

🎨 Styles

Border Mode Styles (matches Ink borders):

  • single, double, round, bold, singleDouble, doubleSingle, classic, arrow

Inset Mode Styles:

  • block: █ thumb, ░ track
  • line: │ thumb, (blank) track
  • thick: ┃ thumb, ╏ track
  • dots: ● thumb, · track

📄 License

MIT