#' @export
groupInput <- function(inputId, ..., left = NULL, right = NULL, class = NULL, size = NULL) {
shiny::addResourcePath(
prefix = "shuny",
directoryPath = fs::path_package("shuny", "www")
)
if (!is.null(size)) {
size <- paste0("input-group-", match.arg(size, c("sm", "lg")))
}
shiny::tagList(
shiny::singleton(tags$head(
tags$script(src = "shuny/input_binding_group.js")
)),
tags$div(
class = classNames("input-group", size),
left,
tags$input(
id = inputId,
type = "text",
class = classNames("shuny-input-group form-control", class),
...
),
right
)
)
}
#' @export
groupAddon <- function(...) {
tags$span(
class = "input-group-addon",
...
)
}
#' @export
groupButton <- function(...) {
tags$span(
class = "input-group-btn",
...
)
}
#' @export
updateGroupInput <- function(session, inputId, ..., value = NULL, placeholder = NULL) {
message <- dropNulls(list(value = value, placeholder = placeholder))
session$sendInputMessage(inputId, message)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.