Displace toggle button in shiny

Can we display toggle button next to Iris title as shown below

image

Below is the code for this

if (interactive()) {
  library(shiny)
  library(shinyWidgets)
  library(DT)
  
  ui <- fluidPage(
    tags$h3("Material switch examples"),
    
    materialSwitch(inputId = "switch1", label = "Night mode"),
    dataTableOutput("df")
  )
  server <- function(input, output) {
    
   output$df <- DT::renderDataTable({
     datatable(head(iris),caption = "Iris",options = list(dom = 'ft'))
   })
    
  }
  shinyApp(ui, server)
}

This topic was automatically closed 54 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.