Adds a new widget to the dock

addWidget(proxy, id, title = "Widget", caption = "Widget", icon = "",
  closable = TRUE, insertmode = "tab-after", refwidgetID = NULL,
  relsize = NULL, ui = shiny::HTML("I am a widget!"))

Arguments

proxy

Either output from the luminophor function, or a Proxy LuminophoR object

id

ID for luminophor widget

title

Title for luminophor widget

caption

Caption for luminophor widget

icon

Font Awesome icon (specified via the icon function)

closable

Create removable

insertmode

How should the widget be added? Options include split-right, split-left, split-bottom, split-top, tab-before, and tab-after (default)

refwidgetID

Reference widget ID for insertmode action

relsize

Relative size of widget (between 0 and 1) in relation to refwidget (or last widget if refwidget isn't specified)

ui

UI content. If just text, need to use HTML(...)

Value

Proxy LuminophoR object

See also

Examples

# Add widget on render if (interactive()) { library(shiny) library(luminophor) shinyApp( ui = fluidPage( fluidRow(column(12, luminophorOutput('lmo', height='90vh'))) ), server = function(input, output) { output$lmo <- renderLuminophor( luminophor() %>% addWidget("mywidget") ) } ) } # Add widget on event if (interactive()) { library(shiny) library(luminophor) shinyApp( ui = fluidPage( sidebarLayout( sidebarPanel( actionButton('add', 'Add Widgets', icon = icon('plus')) ), mainPanel( luminophorOutput('lmo', height='90vh') ) ) ), server = function(input, output) { output$lmo <- renderLuminophor( luminophor() ) observeEvent(input$add, { luminophorProxy('lmo') %>% addWidget("mywidget") }) } ) }