Raxol.Core.Renderer.View.Components.Scroll (Raxol v0.5.0)

View Source

Handles scrollable views for the Raxol view system. Provides viewport management, scrollbar rendering, and content scrolling.

Summary

Functions

Calculates the layout of a scrollable view.

Creates a new scrollable view.

Updates the scroll offset of a view.

Functions

calculate_layout(scroll, available_size)

Calculates the layout of a scrollable view.

new(content, opts \\ [])

Creates a new scrollable view.

Options

  • :viewport - Viewport size {width, height}
  • :offset - Initial scroll offset {x, y}
  • :scrollbars - Whether to show scrollbars (boolean)
  • :fg - Foreground color
  • :bg - Background color

Examples

Scroll.new(content, viewport: {80, 24})
Scroll.new(content, offset: {0, 10}, scrollbars: true)

update_offset(scroll, arg)

Updates the scroll offset of a view.