
Security News
/Company News
Securing the Financial Frontier: How Capital One Uses Socket for Open Source Security
Capital One is partnering with Socket to proactively secure its open source supply chain.
ink-scroll-list
Advanced tools
A high-level ScrollList component for Ink CLI applications, built on top of ink-scroll-view.
selectedIndex).npm install ink-scroll-list
# Peer dependencies
npm install ink react ink-scroll-view
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 = ["First", "Second", "Third", "Fourth", "Fifth", "Sixth"];
useInput((input, key) => {
if (key.upArrow) listRef.current?.selectPrevious();
if (key.downArrow) listRef.current?.selectNext();
});
return (
<ScrollList
ref={listRef}
height={4}
selectedIndex={selectedIndex}
onSelectionChange={setSelectedIndex}
>
{items.map((item, i) => (
<Box key={i}>
<Text color={i === selectedIndex ? "green" : "white"}>
{i === selectedIndex ? "> " : " "}
{item}
</Text>
</Box>
))}
</ScrollList>
);
};
render(<App />);
Extends ScrollViewRef (from ink-scroll-view).
| Method | Description |
|---|---|
scrollToItem(index, mode?) | Scroll to a specific item |
select(index, mode?) | Select an item and scroll to it |
selectNext() | Select the next item |
selectPrevious() | Select the previous item |
selectFirst() | Select the first item |
selectLast() | Select the last item |
getSelectedIndex() | Get current selected index |
isSelectedVisible() | Check if selected item is visible |
getItemCount() | Get total number of items |
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. |
onSelectionChange | (index: number) => void | Callback when selection changes internally. |
MIT
FAQs
A ScrollList component for Ink CLI applications
The npm package ink-scroll-list receives a total of 95,555 weekly downloads. As such, ink-scroll-list popularity was classified as popular.
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
/Company News
Capital One is partnering with Socket to proactively secure its open source supply chain.

Security News
Socket CTO Ahmad Nassri discusses how to keep AI agents from bypassing package blocks, limit credential access, and monitor their actions.

Security News
GPT-6 Astra tried to plant malicious code in simulated open source projects using fake GitHub accounts and deceptive PRs during an assigned CTF challenge.