Skip to content

Horizontal scrolling of the built-in List component #1059

Answered by joshka
kxxt asked this question in Q&A
Discussion options

You must be logged in to vote

(I moved this over to the ratatui repo from the website repo)

There's nothing built-in to the list for this scenario. Depending on how you want this to work, I'd suggest the following approaches:

  • If you're trying to scroll a single line within the list leaving the other lines alone, then you could implement this as a truncation of the item based on the scroll position and selected index. This assumes you're ok with building the list items every time the selection changes (for small lists this is not a measurable problem, for larger ones, it might be).
  • If you're trying to scroll the entire list horizontally, take a look at tui-scrollview as a way to create an intermediate buffer that supp…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@kxxt
Comment options

@kxxt
Comment options

@kxxt
Comment options

@joshka
Comment options

@kxxt
Comment options

Answer selected by kxxt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants