Learn R Programming

shinybones (version 0.2.4)

preview_module: Preview a shiny module in a shinydashboard

Description

Preview a shiny module in a shinydashboard

Usage

preview_module(module, name = "module", use_box = FALSE,
  title = name, titleWidth = NULL, preview = TRUE, ...)

Arguments

module

The server function of a module or its name.

name

The id to pass to callModule while calling it.

use_box

A boolean indicating if the ui should be wrapped in a box

title

The dashboard title to display.

titleWidth

The width of the dashboard title.

preview

A boolean indicating if the return value should be a shinyApp object (default) or a named list with ui and server.

...

Additional parameters to pass to the module

See Also

Other preview: preview_component, preview_datatable

Examples

Run this code
# NOT RUN {
  library(shiny)
  slider_text_ui <- function(id){
    ns <- NS(id)
    tagList(
      sliderInput(ns('num'), 'Enter Number', 0, 1, 0.5),
      textOutput(ns('num_text'))
    )
  }
  slider_text <- function(input, output, session){
     output$num_text <- renderText({input$num})
  }
  preview_module(slider_text, title = 'Slider Text')
  preview_module(slider_text, title = 'Slider Text', use_box = TRUE)
# }

Run the code above in your browser using DataLab