R/ui_selectize.R

Defines functions ui_selectize

Documented in ui_selectize

#' Refactor User Interface `selectizeInput` Function
#' 
#' This function aims to simplify the repetitive call of shiny's selectizeInput function. 
#' It will be called in app.R file.
#' 
#' @param id Input id that will be used in the server side.
#' @param choices List of value to select. 
#' 
#' @examples 
#' ui_selectize("country_select", c("Italy", "Spain", "France", "Austria", "United Kingdom"))
#' 
#' @export
ui_selectize <- function(id, choices){
  shiny::selectizeInput(id, 
                 label = "Step 1: Select or type at least 1 country",
                 choices,
                 selected = c("Italy", "Austria", "Spain"),
                 multiple = TRUE)
}
etc5523-2020/r-package-assessment-Dewi-Amaliah documentation built on Jan. 1, 2021, 1:10 a.m.