dashboardControlbar: Create a Boostrap 4 dashboard right sidebar

Description Usage Arguments Author(s) Examples

Description

Build an adminLTE3 dashboard right sidebar

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
bs4DashControlbar(
  ...,
  id = NULL,
  disable = FALSE,
  width = 250,
  collapsed = TRUE,
  overlay = TRUE,
  skin = "dark",
  pinned = NULL
)

controlbarMenu(
  ...,
  id = NULL,
  selected = NULL,
  type = c("tabs", "pills"),
  position = NULL,
  vertical = FALSE,
  side = "left",
  .list = NULL
)

controlbarItem(title, ..., value = title, icon = NULL)

updateControlbarMenu(
  session = getDefaultReactiveDomain(),
  inputId,
  selected = NULL
)

updateControlbar(id, session = shiny::getDefaultReactiveDomain())

dashboardControlbar(
  ...,
  id = NULL,
  disable = FALSE,
  width = 250,
  collapsed = TRUE,
  overlay = TRUE,
  skin = "dark",
  pinned = NULL
)

Arguments

...

Any UI element.

id

Controlbar id.

disable

If TRUE, the sidebar will be disabled.

width

Controlbar width. This must either be a number which specifies the width in pixels, or a string that specifies the width in CSS units. 250 px by default.

collapsed

Whether the control bar on the right side is collapsed or not at start. TRUE by default.

overlay

Whether the sidebar covers the content when expanded. Default to TRUE.

skin

Controlbar skin. "dark" or "light".

pinned

Whether to block the controlbar state (TRUE or FALSE). Default to NULL.

selected

The value (or, if none was supplied, the title) of the tab that should be selected by default. If NULL, the first tab will be selected.

type
'"tabs"'

Standard tab look

'"pills"'

Selected tabs use the background fill color

position

This argument is deprecated; it has been discontinued in Bootstrap 3.

vertical

Whether to displays tabs vertically. Default to FALSE.

side

Tabs side: "left" or "right".

.list

In case of programmatically generated items. See example.

title

Display title for tab

value

The value that should be sent when tabsetPanel reports that this tab is selected. If omitted and tabsetPanel has an id, then the title will be used.

icon

Optional icon to appear on the tab. This attribute is only valid when using a tabPanel within a navbarPage().

session

Shiny session object.

inputId

The id of the tabsetPanel, navlistPanel, or navbarPage object.

Author(s)

David Granjon, dgranjon@ymail.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
if (interactive()) {
  library(shiny)
  library(bs4Dash)

  shinyApp(
    ui = dashboardPage(
      header = dashboardHeader(),
      sidebar = dashboardSidebar(),
      body = dashboardBody(
        actionButton(inputId = "controlbarToggle", label = "Toggle Controlbar")
      ),
      controlbar = dashboardControlbar(
        id = "controlbar",
        collapsed = FALSE,
        overlay = TRUE
      ),
      title = "updateControlbar"
    ),
    server = function(input, output, session) {
      observeEvent(input$controlbar, {
        if (input$controlbar) {
          showModal(modalDialog(
            title = "Alert",
            "The controlbar is opened.",
            easyClose = TRUE,
            footer = NULL
          ))
        }
      })

      observeEvent(input$controlbarToggle, {
        updateControlbar(id = "controlbar", session = session)
      })

      observe({
        print(input$controlbar)
      })
    }
  )
}

hiplot/bs4Dash2 documentation built on Dec. 20, 2021, 3:51 p.m.