NUI / Components / Scroll, Lists & Data

ScrollBar

ImplementedScroll, Lists & Data

ScrollBar renders a scrollbar control that can be styled and connected to behavior.

Supported as a standalone scrollbar control.

Overview

ScrollBar renders a scrollbar control that can be styled and connected to behavior.

When to use

  • Use ScrollBar when a standalone scrollbar is needed for a custom scroll surface.

Children

Does not support children.

Basic syntax

nui
ScrollBar PanelScrollbar {
    orientation: vertical
}

Supported properties

PropertyTypeRequiredDefaultDescription
orientationenumNoverticalScrollbar direction.
valuenumberNo0Scroll value.
thumbSizenumberNoDefaultThumb size fraction or value.
commandstringNoEmptyEvent Graph command for scroll changes.
enabledboolNotrueWhether the scrollbar can be used.
focusableboolNotrueWhether the scrollbar can receive focus.
backgroundColorcolorNoDefaultTrack color.
thumbColorcolorNoDefaultThumb color.
widthnumberNoAutoDesired width.
heightnumberNoAutoDesired height.
opacitynumberNo1Render opacity.
visibleboolNotrueVisibility flag.

Contextual properties

Contextual property rules

ScrollBar may receive stack, canvas, grid, wrap, or ExpandableArea slot properties only when it is authored as a direct child of the matching parent. See section 7.

Full syntax example

nui
ScrollBar PanelScrollbar {
    orientation: vertical
    value: 0.25
    thumbSize: 0.2
    command: "ScrollChanged"
    enabled: true
    focusable: true
    backgroundColor: "#111827"
    thumbColor: "#64748B"
    width: 12
    height: 240
    opacity: 1
    visible: true
}

Limitations

  • Use ScrollBox for normal scrollable authored content.
  • Use command, not the legacy action alias, in public documentation.