NUI / Components / Input

CheckBox

ImplementedInput

CheckBox renders a boolean check input.

Supported as a boolean input component.

Overview

CheckBox renders a boolean check input.

When to use

  • On/off settings.
  • Toggles that should read as a checkbox.
  • Boolean form choices.

Children

Does not support children.

Basic syntax

nui
CheckBox EnableShadows {
    checked: true
}

Supported properties

PropertyTypeRequiredDefaultDescription
checkedboolNofalseInitial checked state.
enabledboolNotrueWhether the checkbox can be used.
focusableboolNotrueWhether the checkbox can receive focus.
checkColorcolorNoDefaultCheck mark color.
checkedColorcolorNoDefaultChecked background color.
backgroundColorcolorNoDefaultNormal background color.
hoveredColorcolorNoDefaultHover color.
disabledColorcolorNoDefaultDisabled color.
borderColorcolorNoDefaultBorder color.
borderThicknessnumberNo0Border thickness.
radiusnumberNo0Corner radius.
widthnumberNoAutoDesired width.
heightnumberNoAutoDesired height.
opacitynumberNo1Render opacity.
visibleboolNotrueVisibility flag.

Contextual properties

Contextual property rules

CheckBox 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
CheckBox EnableShadows {
    checked: true
    enabled: true
    focusable: true
    checkColor: "#FFFFFF"
    checkedColor: "#275DAD"
    backgroundColor: "#111827"
    hoveredColor: "#1F2937"
    disabledColor: "#4B5563"
    borderColor: "#64748B"
    borderThickness: 1
    radius: 3
    width: 24
    height: 24
    opacity: 1
    visible: true
}

Limitations

  • CheckBox does not support child labels. Use a Row with CheckBox and Text for labeled controls.