InkUI
Components

ScrollArea

Scrollable content region with visible scrollbar track and keyboard navigation.

A scrollable container that displays a visible scrollbar when content exceeds the visible height. Foundation component used by TreeView, DataTable, CodeBlock, and more.

Live Preview
ScrollArea · keyboard scroll
src/
index.ts
utils.ts
config.ts
types.ts
~/my-cli — node v22● running

Installation

npx inkui add scroll-area

Usage

import { ScrollArea } from './components/ui/scroll-area';
import { Text } from 'ink';
 
const items = Array.from({ length: 50 }, (_, i) => (
  <Text key={i}>Line {i + 1}</Text>
));
 
export default function App() {
  return (
    <ScrollArea height={10}>
      {items}
    </ScrollArea>
  );
}

Keyboard Shortcuts

KeyAction
/ kScroll up one line
/ jScroll down one line
Page Up / uScroll up half-page
Page Down / dScroll down half-page
gScroll to top
GScroll to bottom

API Reference

PropTypeDefaultDescription
heightnumberVisible height in rows (required)
scrollbarbooleantrueShow/hide scrollbar
scrollbarCharstring'█'Scrollbar thumb character
trackCharstring'░'Scrollbar track character
onScroll(offset, total) => voidCalled on scroll
focusbooleantrueAccept keyboard input
themeInkUIThemedarkThemeColor theme

On this page