Comma Agents
@comma-agents/tuiComponents

Scrollbar

Single-column vertical scrollbar — presentational, caller-owned scroll model.

Scrollbar

A single-column vertical scrollbar, purely presentational. The caller owns the scroll model -- total, windowSize, and offset. Internally computes thumb position and height from the geometry.

import { Scrollbar } from "@comma-agents/tui";

<Scrollbar total={100} windowSize={20} offset={50} height={20} />

ScrollbarProps

PropTypeDefaultDescription
totalnumber--Total scrollable units (e.g. lines)
windowSizenumber--Visible units
offsetnumber--Zero-based offset into total
heightnumberwindowSizeScrollbar height in rows

The ScrollbarRender component receives thumbTop and thumbHeight values derived from a geometry utility. The thumb is rendered as one or more rows of thumb characters, the track as track characters -- both colored from the theme. When content fits (total <= windowSize), the thumb fills the entire track.

On this page