bs4TabSetPanel: Create a tabSetPanel

Description Usage Arguments Author(s) Examples

View source: R/cards.R

Description

Imported by bs4TabCard but can be used alone.

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
bs4TabSetPanel(
  ...,
  id = NULL,
  side = "left",
  status = NULL,
  tabStatus = NULL,
  .list = NULL,
  vertical = FALSE,
  type = NULL
)

bs4DashControlbarMenu(
  ...,
  id = NULL,
  side = "left",
  status = NULL,
  tabStatus = NULL,
  .list = NULL,
  vertical = FALSE,
  type = NULL
)

tabsetPanel(
  ...,
  id = NULL,
  side = "left",
  status = NULL,
  tabStatus = NULL,
  .list = NULL,
  vertical = FALSE,
  type = NULL
)

Arguments

...

Slot for bs4TabPanel.

id

Unique bs4TabSetPanel id. NULL by default. Set a value to get the currently selected tab.

side

Side of the box the tabs should be on ("left" or "right"). Default to "left".

status

The status of the card header. "primary", "secondary", "success", "warning", "danger", "white", "light", "dark", "transparent". NULL by default.

tabStatus

The status of the tabs buttons over header. "primary", "secondary", "success", "warning", "danger", "white", "light", "dark", "transparent". NULL by default, "light" if status is set. A vector is possible with a colour for each tab button

.list

When elements are programmatically added, pass them here instead of in ...

vertical

Whether to display tabs in a vertical mode. FALSE by default.

type

TabPanel type: "tabs" or "pills". "pills" is the default if type is NULL.

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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
if(interactive()){
 library(shiny)
 library(bs4Dash)

 shiny::shinyApp(
   ui = bs4DashPage(
    navbar = bs4DashNavbar(),
    sidebar = bs4DashSidebar(),
    controlbar = bs4DashControlbar(),
    footer = bs4DashFooter(),
    title = "test",
    body = bs4DashBody(
     
     # manually inserted panels
     bs4TabSetPanel(
      id = "tabcard",
      side = "left",
      bs4TabPanel(
       tabName = "Tab 1", 
       active = FALSE,
       "Content 1"
      ),
      bs4TabPanel(
       tabName = "Tab 2", 
       active = TRUE,
       "Content 2"
      ),
      bs4TabPanel(
       tabName = "Tab 3", 
       active = FALSE,
       "Content 3"
      )
     ),
     
     br(), br(),
     # programmatically inserted panels
     bs4TabSetPanel(
       id = "tabset",
       side = "left",
       .list = lapply(1:3, function(i) {
         bs4TabPanel(
           tabName = paste0("Tab", i), 
           active = FALSE,
           paste("Content", i)
         )
       })
      ),
      
      br(), br(),
      # vertical tabset
      bs4TabSetPanel(
       id = "verttabset",
       side = "left",
       vertical = TRUE,
       .list = lapply(1:3, function(i) {
         bs4TabPanel(
           tabName = paste0("Tab", i), 
           active = FALSE,
           paste("Content", i)
         )
       })
      )
    )
   ),
   server = function(input, output) {}
 )
}

RX-PBB/bs4Mash documentation built on April 11, 2020, 12:15 a.m.