fdSidebar: Create the sidebar of the dashboard.

Description Usage Arguments See Also Examples

Description

This creates a sidebar for the dashboard

Usage

1
fdSidebar(..., sidebarWidth = NULL)

Arguments

...

Items to put in the sidebar.

sidebarWidth

width for the sidebar.

See Also

fdSidebarMenu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
library(flightdeck)
library(htmltools)

# Set up menu for dashboard sidebar
mySidebar <- fdSidebarMenu(
  fdMenuItem("Page1", icon = fdIcon("table"), pageName = 'page1'),
  fdMenuItem("Page2", icon = fdIcon("bar-chart"), pageName = 'page2')
)

# Set up pages for dashboad body
myPages <- list(
  fdPage(p('Page 1'), id = 'page1', display = TRUE),
  fdPage(p('Page 2'), id = 'page2')
)

## Render the dashboard only in interactive R sessions
if (interactive()) {
  fdBoard(
    fdHeader(title = 'My Dashboard'),
    fdSidebar(fdSidebarMenu(mySidebar)),
    fdBody(myPages)
  )
}

alteryx/flightdeck documentation built on May 12, 2019, 1:39 a.m.