navlistPanel: Create a navigation list panel

Description Usage Arguments Details See Also Examples

View source: R/bootstrap.R

Description

Create a navigation list panel that provides a list of links on the left which navigate to a set of tabPanels displayed to the right.

Usage

1
2
3
4
5
6
7
8
navlistPanel(
  ...,
  id = NULL,
  selected = NULL,
  well = TRUE,
  fluid = TRUE,
  widths = c(4, 8)
)

Arguments

...

tabPanel() elements to include in the navlist

id

If provided, you can use input$id in your server logic to determine which of the current navlist items is active. The value will correspond to the value argument that is passed to tabPanel().

selected

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

well

TRUE to place a well (gray rounded rectangle) around the navigation list.

fluid

TRUE to use fluid layout; FALSE to use fixed layout.

widths

Column withs of the navigation list and tabset content areas respectively.

Details

You can include headers within the navlistPanel by including plain text elements in the list. Versions of Shiny before 0.11 supported separators with "——", but as of 0.11, separators were no longer supported. This is because version 0.11 switched to Bootstrap 3, which doesn't support separators.

See Also

tabPanel(), updateNavlistPanel(), insertTab(), showTab()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
fluidPage(

  titlePanel("Application Title"),

  navlistPanel(
    "Header",
    tabPanel("First"),
    tabPanel("Second"),
    tabPanel("Third")
  )
)

Example output

<div class="container-fluid">
  <h2>Application Title</h2>
  <div class="row">
    <div class="col-sm-4 well">
      <ul class="nav nav-pills nav-stacked">
        <li class="navbar-brand">Header</li>
        <li class="active">
          <a href="#tab-9316-1" data-toggle="tab" data-value="First">First</a>
        </li>
        <li>
          <a href="#tab-9316-2" data-toggle="tab" data-value="Second">Second</a>
        </li>
        <li>
          <a href="#tab-9316-3" data-toggle="tab" data-value="Third">Third</a>
        </li>
      </ul>
    </div>
    <div class="col-sm-8">
      <div class="tab-content">
        <div class="tab-pane active" data-value="First" id="tab-9316-1"></div>
        <div class="tab-pane" data-value="Second" id="tab-9316-2"></div>
        <div class="tab-pane" data-value="Third" id="tab-9316-3"></div>
      </div>
    </div>
  </div>
</div>

shiny documentation built on Jan. 26, 2021, 1:06 a.m.