Raxol.UI.Components.Display.Viewport (Raxol v2.6.0)

View Source

A scrollable container that displays a windowed view of content that may exceed its visible bounds.

Supports vertical and horizontal scrolling via keyboard (arrow keys, Page Up/Down, Home/End) and programmatic scroll control.

Content is provided as a list of child elements. The viewport renders only the visible slice based on scroll_top and visible_height.

Summary

Types

t()

@type t() :: %{
  id: any(),
  children: [map()],
  content_source: struct() | nil,
  scroll_top: non_neg_integer(),
  scroll_left: non_neg_integer(),
  visible_height: pos_integer(),
  visible_width: pos_integer() | nil,
  content_height: non_neg_integer(),
  style: map(),
  theme: map(),
  show_scrollbar: boolean(),
  focused: boolean()
}