
Security News
arXiv Is Rate Limiting Authors Following a Flood of AI Slop Submissions
arXiv now limits authors to two submissions a month as AI slop overwhelms moderators, delays good papers, and sparks debate over applying the limit to everyone.
ink-scroll-list
Advanced tools
A high-level ScrollList component for Ink CLI applications, built on top of ink-scroll-view.
selectedIndex).auto, top, bottom, center).npm install ink-scroll-list
# Peer dependencies
npm install ink react
ScrollList manages the selectedIndex state internally if you don't provide it, but typically you'll want to control it to respond to user input.
import React, { useRef, useState } from "react";
import { render, Text, Box, useInput } from "ink";
import { ScrollList, ScrollListRef } from "ink-scroll-list";
const App = () => {
const listRef = useRef<ScrollListRef>(null);
const [selectedIndex, setSelectedIndex] = useState(0);
const items = Array.from({ length: 20 }).map((_, i) => `Item ${i + 1}`);
useInput((input, key) => {
if (key.upArrow) {
// selectPrevious returns the new index
const newIndex = listRef.current?.selectPrevious() ?? 0;
setSelectedIndex(newIndex);
}
if (key.downArrow) {
// selectNext returns the new index
const newIndex = listRef.current?.selectNext() ?? 0;
setSelectedIndex(newIndex);
}
if (key.return) {
console.log(`Selected: ${items[selectedIndex]}`);
}
});
return (
<Box borderStyle="single" height={10}>
<ScrollList
ref={listRef}
selectedIndex={selectedIndex}
onSelectionChange={setSelectedIndex}
>
{items.map((item, i) => (
<Box key={i}>
<Text color={i === selectedIndex ? "green" : "white"}>
{i === selectedIndex ? "> " : " "}
{item}
</Text>
</Box>
))}
</ScrollList>
</Box>
);
};
render(<App />);
For detailed API documentation, see API Reference.
ScrollListProps)Extends ScrollViewProps from ink-scroll-view.
| Prop | Type | Description |
|---|---|---|
selectedIndex | number | The currently selected item index. |
scrollAlignment | 'auto' | 'top' | 'bottom' | 'center' | Alignment mode for selected item. Default: 'auto'. |
onSelectionChange | (index: number) => void | Callback when selection changes internally (e.g. via selectNext). |
| ... | ScrollViewProps | All props from ScrollView (onScroll, onViewportSizeChange, etc.). |
ScrollListRef)Extends ScrollViewRef from ink-scroll-view. Access these via ref.current.
| Method | Signature | Description |
|---|---|---|
scrollToItem | (index: number, mode?: Alignment) => void | Scroll to a specific item. |
select | (index: number, mode?: Alignment) => void | Select an item and scroll to it. |
selectNext | () => number | Select the next item. Returns new index. |
selectPrevious | () => number | Select the previous item. Returns new index. |
selectFirst | () => number | Select the first item. Returns 0. |
selectLast | () => number | Select the last item. Returns new index. |
getSelectedIndex | () => number | Get current selected index. |
getItemCount | () => number | Get total number of items. |
| ... | ScrollViewRef | All methods from ScrollView (scrollTo, scrollBy, remeasure, etc.). |
ScrollList can manage its own state, it's best practice to lift the selectedIndex state up to your component (as shown in the usage example) so you can use it for rendering your items (highlighting, etc.).ScrollList uses ink-scroll-view under the hood, so it benefits from the same performance optimizations (virtual viewport, optimistic updates).ScrollView, ScrollList supports items with variable and changing heights.process.stdout's resize event and call remeasure() on the ref.This package is part of a family of Ink scroll components:
| Package | Description |
|---|---|
| ink-scroll-view | Core scroll container component |
| ink-scroll-list | A scrollable list with focus management and item selection (this package) |
| ink-scroll-bar | A standalone scrollbar component for any scroll container |
MIT
FAQs
A ScrollList component for Ink CLI applications
We found that ink-scroll-list demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
arXiv now limits authors to two submissions a month as AI slop overwhelms moderators, delays good papers, and sparks debate over applying the limit to everyone.

Research
/Security News
A new GhostAction wave hits hundreds of GitHub repos, expanding CI/CD secret theft to cloud and AI credentials in source code and git history.

Research
/Security News
Tensorlake npm SDK version 0.5.144 was compromised in a ChainDrop / Shai-Hulud attack, delivering credential-stealing malware.