Skip to contents

dashboardUser to insert in the rightUi or leftUi slot of dashboardHeader.

This can be inserted in a dashboardUser.

This can be used as a placeholder for dynamically-generated dashboardUser.

Usage

bs4UserMenu(
  ...,
  name = NULL,
  image = NULL,
  title = NULL,
  subtitle = NULL,
  footer = NULL,
  status = NULL
)

dashboardUserItem(item, width)

userOutput(id, tag = shiny::tags$li)

renderUser(expr, env = parent.frame(), quoted = FALSE, outputArgs = list())

dashboardUser(
  ...,
  name = NULL,
  image = NULL,
  title = NULL,
  subtitle = NULL,
  footer = NULL,
  status = NULL
)

Arguments

...

Body content. Slot for dashboardUserItem.

name

User name.

image

User profile picture.

title

A title.

subtitle

A subtitle.

Footer is any.

status

Ribbon status. Valid colors are defined as follows:

  • primary: #007bff .

  • secondary: #6c757d .

  • info: #17a2b8 .

  • success: #28a745 .

  • warning: #ffc107 .

  • danger: #dc3545 .

  • gray-dark: #343a40 .

  • gray: #adb5bd .

  • white: #fff .

  • indigo: #6610f2 .

  • lightblue: #3c8dbc .

  • navy: #001f3f .

  • purple: #605ca8 .

  • fuchsia: #f012be .

  • pink: #e83e8c .

  • maroon: #d81b60 .

  • orange: #ff851b .

  • lime: #01ff70 .

  • teal: #39cccc .

  • olive: #3d9970 .

item

HTML Tag.

width

Item width between 1 and 12.

id

Output variable name.

tag

A tag function, like tags$li or tags$ul.

expr

An expression that returns a Shiny tag object, HTML(), or a list of such objects.

env

The parent environment for the reactive expression. By default, this is the calling environment, the same as when defining an ordinary non-reactive expression. If expr is a quosure and quoted is TRUE, then env is ignored.

quoted

If it is TRUE, then the quote()ed value of expr will be used when expr is evaluated. If expr is a quosure and you would like to use its expression as a value for expr, then you must set quoted to TRUE.

outputArgs

A list of arguments to be passed through to the implicit call to uiOutput() when renderUI is used in an interactive R Markdown document.

See also

renderUser for the corresponding server side function and examples.

userOutput for the corresponding client side function and examples.

Examples

if (interactive()) {
  library(shiny)
  library(bs4Dash)

  shinyApp(
    ui = dashboardPage(
      header = dashboardHeader(rightUi = userOutput("user")),
      sidebar = dashboardSidebar(),
      body = dashboardBody(),
      title = "DashboardPage"
    ),
    server = function(input, output) {
      output$user <- renderUser({
        dashboardUser(
          name = "Divad Nojnarg",
          image = "https://adminlte.io/themes/AdminLTE/dist/img/user2-160x160.jpg",
          title = "shinydashboardPlus",
          subtitle = "Author",
          footer = p("The footer", class = "text-center"),
          fluidRow(
            dashboardUserItem(
              width = 6,
              "Item 1"
            ),
            dashboardUserItem(
              width = 6,
              "Item 2"
            )
          )
        )
      })
    }
  )
}