Documentation
Checkbox

Checkbox

Checkbox is a component that allows one to make a binary choice (on or off).

Usage Example

local signal = n.create_signal({
  is_preview_visible = false,
})
 
n.checkbox({
  label = "Display preview",
  value = signal.is_preview_visible,
  on_change = function(is_checked)
    signal.is_preview_visible = is_checked
  end,
})

Properties

label

Type
string

value

Default value
false
Type
boolean

on_change

Default value
fn.ignore
Type
fun(is_checked: boolean): nil

press_key

Default value
{ "CR", "Space" }
Type
string[] | string

checked_sign

Default value
[x]
Type
string

default_sign

Default value
[ ]
Type
string

prepare_lines

Type
fun(is_checked: boolean, lines: NuiLine[], component: Checkbox): nil

Highlight Groups

  • NuiComponentsCheckboxLabel
  • NuiComponentsCheckboxIcon
  • NuiComponentsCheckboxLabelChecked
  • NuiComponentsCheckboxIconChecked