class RatatuiRuby::ScrollbarState

Mutable state object for Scrollbar widgets.

When using {Frame#render_stateful_widget}, the State object is the *single source of truth* for position and content length. Widget properties (position, content_length) are ignored in stateful mode.

Example

@scrollbar_state = RatatuiRuby::ScrollbarState.new(100)
@scrollbar_state.position = 25

RatatuiRuby.draw do |frame|
  scrollbar = RatatuiRuby::Scrollbar.new(orientation: :vertical_right)
  frame.render_stateful_widget(scrollbar, frame.area, @scrollbar_state)
end