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,
global_press_key = "<C-d>"
on_change = function(is_checked)
signal.is_preview_visible = is_checked
end,
})Properties
label
Type
stringvalue
Default value
falseType
booleanon_change
Default value
fn.ignoreType
fun(is_checked: boolean): nilpress_key
Default value
{ "CR", "Space" }Type
string[] | stringchecked_sign
Default value
[x]Type
stringdefault_sign
Default value
[ ]Type
stringglobal_press_key
Type
string[] | stringprepare_lines
Type
fun(is_checked: boolean, lines: NuiLine[], component: Checkbox): nilHighlight Groups
NuiComponentsCheckboxLabelNuiComponentsCheckboxIconNuiComponentsCheckboxLabelCheckedNuiComponentsCheckboxIconChecked