NUI / Components / Input

Slider

ImplementedInput

Slider renders a numeric value input over a min/max range.

Supported as a numeric input component.

Overview

Slider renders a numeric value input over a min/max range.

When to use

  • Volume.
  • Brightness.
  • Sensitivity.
  • Progress-like settings.
  • Continuous numeric options.

Children

Does not support children.

Basic syntax

nui
Slider Volume {
    value: 0.75
    min: 0
    max: 1
}

Supported properties

PropertyTypeRequiredDefaultDescription
valuenumberYes0Current value.
minnumberNo0Minimum value.
maxnumberNo1Maximum value.
stepnumberNoUnsetStep amount.
orientationenumNohorizontalSlider orientation.
enabledboolNotrueWhether the slider can be used.
focusableboolNotrueWhether the slider can receive focus.
lockedboolNofalsePrevents interactive changes.
fillColorcolorNoDefaultFilled track color.
backgroundColorcolorNoDefaultTrack color.
thumbColorcolorNoDefaultThumb color.
hoveredColorcolorNoDefaultHover color.
disabledColorcolorNoDefaultDisabled color.
widthnumberNoAutoDesired width.
heightnumberNoAutoDesired height.
opacitynumberNo1Render opacity.
visibleboolNotrueVisibility flag.

Contextual properties

Contextual property rules

Slider 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
Slider Volume {
    value: 0.75
    min: 0
    max: 1
    step: 0.05
    orientation: horizontal
    enabled: true
    focusable: true
    locked: false
    fillColor: "#3DDC84"
    backgroundColor: "#202733"
    thumbColor: "#FFFFFF"
    hoveredColor: "#3976CF"
    disabledColor: "#4B5563"
    width: 240
    height: 20
    opacity: 1
    visible: true
}

Limitations

  • Slider is childless. Use a surrounding Row or Column for labels and value text.