#' Checkbox module UI
#'
#' @description A checkbox module UI for shiny applications
#' declaration
#' @param id is unique ID associated with the button for the UI namespace
#'
#' @return HTML UI code for a shiny application
#' @name checkbox_ui
#'
#' @importFrom shiny uiOutput
#'
#' @export
checkbox_ui<-function(id){
ns<-NS(id)
uiOutput(ns("check"))
}
#' Checkbox module Server
#'
#' @description A checkbox module UI for shiny applications
#' declaration
#' @param input list of inputs used in the shiny application session
#' @param output list of outputs used the shiny application session
#' @param session The shiny app session object
#' @param label Text label of what should be on the checkbox
#' @param value logical. True or False flag for the radio buttons default selection
#'
#' @return logical. Checkbox value
#'
#' @importFrom shiny checkboxInput
#'
#' @export
#'
checkbox_server<-function(input, output, session,label = "Scale?", value = F){
ns<-session$ns
output[['check']]<-shiny::renderUI({
checkboxInput(ns("check"),label = label, value = value)
})
return(list(check = reactive(input$check)))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.