A text input. A group text input is an alternative text input. The group text input allows you to include static prefixes or buttons with a standard text input.

numberInput() is a simple wrapper around textInput() with type set to "number" and explicit arguments for specifying a min value, max value, and the step amount. Use updateTextInput() to update a number input.

textInput(id, value = NULL, placeholder = NULL, ..., type = "text")

numberInput(
  id,
  value = NULL,
  placeholder = NULL,
  ...,
  min = NULL,
  max = NULL,
  step = 1
)

updateTextInput(
  id,
  value = NULL,
  enable = NULL,
  disable = NULL,
  valid = NULL,
  invalid = NULL,
  session = getDefaultReactiveDomain()
)

groupTextInput(
  id,
  value = NULL,
  placeholder = NULL,
  ...,
  type = "text",
  left = NULL,
  right = NULL
)

updateGroupTextInput(
  id,
  value = NULL,
  enable = NULL,
  disable = NULL,
  valid = NULL,
  invalid = NULL,
  session = getDefaultReactiveDomain()
)

Arguments

id

A character string specifying the id of the reactive input.

value

A character string or a value coerced to a character string specifying the default value of the textual input.

placeholder

A character string specifying placeholder text for the input, defaults to NULL, in which case there is no placeholder text.

...

Additional named arguments passed as HTML attributes to the parent element or tag elements passed as child elements to the parent element.

type

One of "color", "date", "datetime-local", "email", "month", "number", "password", "search", "tel", "text", "time", "url" or "week" specifying the type of text input, defaults to "text".

For details on a particular type please see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input.

min

A number specifying the minimum allowed value of the number input, defaults to NULL.

max

A number specifying the maximum allowed value of the number input, defaults to NULL.

step

A number specifying the increment step of the number input, defaults to 1.

enable

One of values specifying particular choices to enable or TRUE specifying the entire input is enabled, defaults to NULL.

disable

One of values specifying particular choices to disable or TRUE specifying the entire input is disabled, defaults to NULL.

valid

A character string specifying a message to the user indicating how the input's value is valid, defaults to NULL.

invalid

A character string specifying a message to the user indicating how the input's value is invalid, defaults to NULL.

session

A reactive context, defaults to getDefaultReactiveDomain().

left

A character vector specifying static addons or buttonInput() or dropdown() elements specifying dynamic addons. Addons affect the reactive value of the group input, see the Details section below for more information.

left is character or right is character

If left or right are character vectors, then the group input functions like a text input. The value will update and trigger a reactive event when the text box is modified. The group input's reactive value is the concatenation of the static addons specified by left or right and the value of the text input.

left is button or right is button

The button does not change the value of the group input. However, the input no longer triggers event when the text box is updated. Instead the value is updated when a button is clicked. Static addons are still applied to the group input value.

left is a dropdown or right is a dropdown

The value of the group input does chance depending on the clicked dropdown menu item. The value of the input group is the concatenation of the dropdown input value, the value of the text input, and any static addons.

right

A character vector specifying static addons or buttonInput() or dropdown() elements specifying dynamic addons. Addons affect the reactive value of the group input, see the Details section below for more information.

left is character or right is character

If left or right are character vectors, then the group input functions like a text input. The value will update and trigger a reactive event when the text box is modified. The group input's reactive value is the concatenation of the static addons specified by left or right and the value of the text input.

left is button or right is button

The button does not change the value of the group input. However, the input no longer triggers event when the text box is updated. Instead the value is updated when a button is clicked. Static addons are still applied to the group input value.

left is a dropdown or right is a dropdown

The value of the group input does chance depending on the clicked dropdown menu item. The value of the input group is the concatenation of the dropdown input value, the value of the text input, and any static addons.

See also

Examples

### Default text input textInput(id = "text")
#> <div class="yonder-textual" id="text"> #> <input class="form-control" type="text" autocomplete="off"/> #> <div class="valid-feedback"></div> #> <div class="invalid-feedback"></div> #> </div>
### Default number input numberInput(id = "num1")
#> <div class="yonder-textual" id="num1"> #> <input class="form-control" type="number" autocomplete="off" step="1"/> #> <div class="valid-feedback"></div> #> <div class="invalid-feedback"></div> #> </div>
### Specify `min`, `max`, and `step` numberInput( id = "num2", min = 1, max = 10, step = 2 )
#> <div class="yonder-textual" id="num2"> #> <input class="form-control" type="number" autocomplete="off" min="1" max="10" step="2"/> #> <div class="valid-feedback"></div> #> <div class="invalid-feedback"></div> #> </div>