rshinybs4dash

Running bs4Dash shiny example - unused argument


I am running the following snippet of code from the bs4Dash documentation:

 library(bs4Dash)

 shiny::shinyApp(
   ui = bs4DashPage(
    navbar = bs4DashNavbar(),
    sidebar = bs4DashSidebar(),
    controlbar = bs4DashControlbar(),
    footer = bs4DashFooter(),
    title = "test",
    body = bs4DashBody()
   ),
   server = function(input, output) {}
 )

but I am getting this error:

Warning: Error in bs4DashPage: unused argument (navbar = bs4DashNavbar())
  64: force
  63: uiHttpHandler
  62: shiny::shinyApp
   1: runApp

...any idea what the deal is here?

Thanks!


Solution

  • navbar argument has been removed and you need to pass it into header.

    library(bs4Dash)
    
    shiny::shinyApp(
        ui = bs4DashPage(
            header = bs4DashNavbar(title = "My Shiny app"),
            sidebar = bs4DashSidebar(),
            controlbar = bs4DashControlbar(),
            footer = bs4DashFooter(),
            title = "test",
            body = bs4DashBody()
        ),
        server = function(input, output) {}
    )