sidebar_user_panel | R Documentation |
This creates an user panel using Semantic UI styles.
sidebar_user_panel(name, subtitle = NULL, image = NULL, image_size = "tiny")
sidebarUserPanel(name, subtitle = NULL, image = NULL, image_size = "tiny")
name |
Name of the user |
subtitle |
Information to be displayed below the name (for example if the user is online) |
image |
Path to an image. This can be a relative link to an existing 'www/' directory, or an URL to an image |
image_size |
CSS class to display the image, see Semantic documentation for all sizes (goes from 'mini' to 'massive') |
A div tag with the user panel
sidebarUserPanel()
: Create a sidebar user panel (alias for
sidebar_user_panel
for compatibility with shinydashboard
)
sidebarUserPanel(
"Some Name",
subtitle = shiny::a(href = "#", icon("circle"), "Online"),
# Image file should be in www/ subdir
# or a link to a image
image = "some_image_located_inside_www_dir.jpg",
image_size = "mini"
)
ui_user <- sidebarUserPanel(
"Jane Smith",
subtitle = shiny::a(href = "#", icon("circle"), "Online"),
# Image file should be in www/ subdir
# or a link to a image
image = base::system.file(
file.path('examples', "www", "jane_smith.jpg"),
package = "semantic.dashboard"
),
image_size = "mini"
)
if (interactive()) {
ui <- dashboardPage(
dashboardHeader(),
dashboardSidebar(
ui_user,
sidebarMenu(
menuItem("Tab 1", tabName = "tab1"),
menuItem("Tab 2", tabName = "tab2")
)
),
body = dashboardBody(
tabItems(
tabItem(tabName = "tab1", h2("Tab 1")),
tabItem(tabName = "tab2", h2("Tab 2"))
)
)
)
server <- function(input, output, session) {}
shinyApp(ui, server)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.