Skip to content

ScrollBar

A ScrollBar element that can be attached to other elements to control their scroll properties

Extends: VisualElement

Properties

PropertyTypeDefaultDescription
valuenumber0Current scroll value
minnumber0Minimum scroll value
maxnumber100Maximum scroll value
stepnumber1Step size for scroll operations
dragMultipliernumber1How fast the ScrollBar moves when dragging
symbolstring"" Symbol used for the ScrollBar handle
backgroundSymbolstring"\127"Symbol used for the ScrollBar background
symbolBackgroundColorcolorblackBackground color of the ScrollBar handle
backgroundSymbolstring"\127"Symbol used for the ScrollBar background
minValuenumberfunction0
maxValuenumberfunction100
orientationstringverticalOrientation of the ScrollBar ("vertical" or "horizontal")
handleSizenumber2Size of the ScrollBar handle in characters

Functions

MethodReturnsDescription
ScrollBar:attachScrollBarAttaches the ScrollBar to an element's property
ScrollBar:updateAttachedElementScrollBarUpdates the attached element's property based on the ScrollBar value

ScrollBar:attach(element, config)

Attaches the ScrollBar to an element's property

Parameters

  • element BaseElement The element to attach to
  • config table Configuration

Returns

  • ScrollBar self The ScrollBar instance

ScrollBar:updateAttachedElement()

Updates the attached element's property based on the ScrollBar value

Returns

  • ScrollBar self The ScrollBar instance

Released under the MIT License.