Prompt
Prompt is a custom single-line TextInput component that includes a prefix and an on_submit callback.

Usage Example
n.prompt({
prefix = " > ",
placeholder = "Enter a command",
border_label = {
text = "Command",
align = "center",
},
on_submit = function(value)
print(value)
end,
})Properties
value
Type
stringprefix
Type
stringplaceholder
Optional placeholder text to show when the input is empty. Can be a string, a single virtual text chunk, or a list of virtual text chunks.
Default value
nilType
string | { [1]: string, [2]: string }[] | nilA virtual text chunk is a tuple-like table where the first element is the text and the second element is the highlight group.
local placeholder = {
{ "Hello", "Comment" },
{ "World", "String" },
}on_change
Type
fun(value: string, component: Prompt): nilon_submit
Type
fun(value: string, component: Prompt): nilsubmit_key
Default value
<CR>Type
string[] | stringHightlight Groups
NuiComponentsPromptPrefix