ReferencePackages
@mwillbanks/tuil-scroll
Shared terminal scroll containers, viewports, anchoring, culling, and restoration for tuil.
Overview
Shared terminal scroll containers, viewports, anchoring, culling, and restoration for tuil.
@mwillbanks/tuil-scroll is independently installable and also participates in the
umbrella @mwillbanks/tuil runtime where applicable.
Installation
npm install @mwillbanks/tuil-scrollHow it operates
Shared scrolling manages bounded offsets, sticky edges, anchoring, nested wheel routing, variable measurements, culling, restoration, and scrollbar projection.
API
| API | Signature | Description |
|---|---|---|
ScrollAlignment | type ScrollAlignment | Public type ScrollAlignment. |
ScrollAreaOptions | interface ScrollAreaOptions | Public interface ScrollAreaOptions. |
ScrollAreaState | class ScrollAreaState | Public class ScrollAreaState. |
ScrollAxis | type ScrollAxis | Public type ScrollAxis. |
scrollbar | function scrollbar | Public function scrollbar. |
ScrollExtent | interface ScrollExtent | Public interface ScrollExtent. |
ScrollManager | class ScrollManager | Public class ScrollManager. |
ScrollPosition | interface ScrollPosition | Public interface ScrollPosition. |
ScrollSnapshot | interface ScrollSnapshot | Public interface ScrollSnapshot. |
ScrollViewport | interface ScrollViewport | Public interface ScrollViewport. |
Events and lifecycle
Each area exposes immutable snapshots through a subscription.
All subscriptions and registrations return a disposer or belong to an owning runtime that disposes them in reverse order.
Example
import { ScrollAreaState } from "@mwillbanks/tuil-scroll";
const area = new ScrollAreaState({ id: "logs", viewport, extent });