| input | R Documentation |
A focusable text field.
input(
value = "",
placeholder = "",
id = NULL,
classes = NULL,
style = NULL,
disabled = FALSE,
password = FALSE,
max_length = NULL,
validate = NULL
)
value |
Initial text. |
placeholder |
Text shown while the input is empty. |
id |
Optional identifier (for |
classes |
Optional classes (for |
style |
A |
disabled |
Disabled inputs cannot be focused or edited. |
password |
Show bullets instead of the typed characters. |
max_length |
Maximum number of characters. |
validate |
Optional |
Keys: typing inserts at the cursor (replacing a selection);
Left/Right/Home/End move (Ctrl+E: end); Ctrl+Left/Right move by word;
Shift (+Ctrl) with those keys selects; Ctrl+A selects all;
Backspace/Delete delete a character or the selection;
Ctrl+Backspace / Alt+Backspace / Ctrl+W and Ctrl+Delete / Alt+D delete a
word; Ctrl+U / Ctrl+K delete to the start / end; Ctrl+C, Ctrl+X and
Ctrl+V copy, cut and paste with the app clipboard (app$clipboard;
Ctrl+C without a selection keeps its app meaning, quit by default).
The mouse places the cursor; shift+click and dragging select.
Messages (event$data): "input.changed" (value, valid) on every
change, "input.submitted" (value, valid) on Enter, and
"input.valid" / "input.invalid" (value, error) when the result of
validate changes. Invalid inputs have the :invalid state (red
border by default).
An Input widget. Read or set the text with $value; see also
$valid, $error, $selection, $select_range().
name <- input(placeholder = "Your name", id = "name",
validate = function(x) if (!nzchar(x)) "Required")
name$valid
name$value <- "Ada"
name$valid
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.