A scrollbar widget for indicating scroll position in content.
Fields
:orientation- one of:vertical_right(default),:vertical_left,:horizontal_bottom,:horizontal_top:content_length- total number of scrollable items or lines:position- current scroll position (zero-based):viewport_content_length- number of visible items (optional, improves thumb sizing):thumb_style-%ExRatatui.Style{}for the scrollbar thumb:track_style-%ExRatatui.Style{}for the scrollbar track:thumb_symbol- custom character for the thumb (optional):track_symbol- custom character for the track (optional):begin_symbol- custom character for the start arrow (optional):end_symbol- custom character for the end arrow (optional)
Examples
iex> %ExRatatui.Widgets.Scrollbar{content_length: 100, position: 25}
%ExRatatui.Widgets.Scrollbar{
orientation: :vertical_right,
content_length: 100,
position: 25,
viewport_content_length: nil,
thumb_style: %ExRatatui.Style{},
track_style: %ExRatatui.Style{},
thumb_symbol: nil,
track_symbol: nil,
begin_symbol: nil,
end_symbol: nil
}
Summary
Types
@type orientation() ::
:vertical_right | :vertical_left | :horizontal_bottom | :horizontal_top
@type t() :: %ExRatatui.Widgets.Scrollbar{ begin_symbol: String.t() | nil, content_length: non_neg_integer(), end_symbol: String.t() | nil, orientation: orientation(), position: non_neg_integer(), thumb_style: ExRatatui.Style.t(), thumb_symbol: String.t() | nil, track_style: ExRatatui.Style.t(), track_symbol: String.t() | nil, viewport_content_length: non_neg_integer() | nil }