sidebarPanel: Create a sidebar panel

Description Usage Arguments Value Examples

View source: R/bootstrap.R

Description

Create a sidebar panel containing input controls that can in turn be passed to sidebarLayout.

Usage

1

Arguments

...

UI elements to include on the sidebar

width

The width of the sidebar. For fluid layouts this is out of 12 total units; for fixed layouts it is out of whatever the width of the sidebar's parent column is.

Value

A sidebar that can be passed to sidebarLayout

Examples

1
2
3
4
5
6
7
8
# Sidebar with controls to select a dataset and specify
# the number of observations to view
sidebarPanel(
  selectInput("dataset", "Choose a dataset:",
              choices = c("rock", "pressure", "cars")),

  numericInput("obs", "Observations:", 10)
)

Example output

<div class="col-sm-4">
  <form class="well">
    <div class="form-group shiny-input-container">
      <label class="control-label" for="dataset">Choose a dataset:</label>
      <div>
        <select id="dataset"><option value="rock" selected>rock</option>
<option value="pressure">pressure</option>
<option value="cars">cars</option></select>
        <script type="application/json" data-for="dataset" data-nonempty="">{}</script>
      </div>
    </div>
    <div class="form-group shiny-input-container">
      <label for="obs">Observations:</label>
      <input id="obs" type="number" class="form-control" value="10"/>
    </div>
  </form>
</div>

shiny documentation built on Nov. 3, 2018, 1:03 a.m.