preview_module: Preview a shiny module in a shinydashboard

Description Usage Arguments See Also Examples

View source: R/preview.R

Description

Preview a shiny module in a shinydashboard

Usage

1
2
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## 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)

## End(Not run)

ramnathv/satin documentation built on March 7, 2020, 2:03 a.m.