Button
Button
is a component that allows one to interact with it by pressing it.
Usage Example
n.button({
label = "Quit",
global_press_key = "<C-d>"
on_press = function()
-- do something on press
end,
})
Properties
label
Type
string
on_press
Default value
fn.ignore
Type
fun(): nil
press_key
Default value
{ "CR", "Space" }
Type
string[] | string
is_active
Default value
false
Type
boolean
global_press_key
Type
string[] | string
prepare_lines
Type
fun(lines: NuiLine[], component: Button): nil
Highlight Groups
NuiComponentsButton
NuiComponentsButtonActive
NuiComponentsButtonFocus