shiny use renderUI

I want to get user information from the database, and then render the bs4UserMenu function, but it doesn’t seem to work.How should I do?

if (interactive()) {
  library(shiny)
  library(bs4Dash)
  list <- list(name = "Divad Nojnarg")
  shinyApp(
    ui = dashboardPage(
      navbar = dashboardHeader(
        rightUi = uiOutput("user"),
      sidebar = dashboardSidebar(),
      body = dashboardBody(),
      title = "bs4UserMenu"
    )),
    server = function(input, output) {
      output$user <- renderUI({
        bs4UserMenu(
          name = list$name, 
          status = "primary",
          src = "https://adminlte.io/themes/AdminLTE/dist/img/user2-160x160.jpg", 
          title = "bs4Dash",
          subtitle = "Author", 
          footer = p("The footer", class = "text-center"),
          "This is the menu content."
        )
      })
    }
  )
}

What database? There is no database here.

I have solved it, thanks. :grinning:

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.