Learn R Programming

yonder (version 0.1.0)

groupInput: Group inputs, combination button, dropdown, and text input

Description

A group input is a combination reactive input which may consist of one or two buttons, dropdowns, static addons, or any combination of these elements. Static addons, specified with left and right may be used to ensure an group input's reactive value always has a certain prefix or suffix. These static addons render with a shaded background to help indicated this behavior to the user. Buttons and dropdowns may be included to control when the group input's reactive value updates. See Details for more information.

Usage

groupInput(id, value = NULL, placeholder = NULL, left = NULL,
  right = NULL, ...)

Arguments

id

A character string specifying the id of the reactive input.

value

A character string specifying an initial value for the input group, defaults to NULL.

placeholder

A character string specifying placeholder text for the input group, defaults to NULL.

left, right

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

...

Additional named arguments passed as HTML attributes to the parent element.

<code>left</code> and <code>right</code> combinations

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 concatention 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 concatentation of the dropdown input value, the value of the text input, and any static addons.

See Also

Other inputs: buttonGroupInput, buttonInput, checkboxInput, chipInput, fileInput, formInput, listGroupInput, menuInput, navInput, radioInput, rangeInput, selectInput, sliderInput, textInput

Examples

Run this code
# NOT RUN {
### Simple character string addon

# This input will always append a "@".

groupInput(
  id = "group1",
  left = "@",
  placeholder = "Username"
)

### Text input and button combo

groupInput(
  id = "group2",
  placeholder = "Search terms",
  right = buttonInput(
    id = "button2",
    label = "Go!"
  ) %>%
    background("grey") %>%
    border()
)

### Combination addon

groupInput(
  id = "group3",
  left = c("$", "0.")
)

### Two addons

groupInput(
  id = "group4",
  left = "@",
  placeholder = "Username",
  right = buttonInput(
    id = "button4",
    label = "Search"
  ) %>%
    background("blue")
)

# }

Run the code above in your browser using DataLab