Skip to contents

[Experimental]
Designed to be grouped using panel_group element. Used to handle shiny inputs in the encoding panel.

Usage

panel_item(title, ..., collapsed = TRUE, input_id = NULL)

Arguments

title

(character)
title of panel

...

content of panel

collapsed

(logical) optional,
whether to initially collapse panel

input_id

(character) optional
name of the panel item element. If supplied, this will register a shiny input variable that indicates whether the panel item is open or collapsed and is accessed with input$input_id.

Value

(shiny.tag)

Examples


library(shiny)
panel_item(
  title = "Display",
  collapsed = FALSE,
  checkboxGroupInput(
    "check",
    "Tables display",
    choices = LETTERS[1:3],
    selected = LETTERS[1]
  ),
  radioButtons(
    "radio",
    label = "Plot type",
    choices = letters[1:2],
    selected = letters[1]
  )
)
#> <div>
#>   <div id="_div" class="panel panel-default">
#>     <div class="panel-heading " data-toggle="collapse" href="#_panel_body_1023" aria-expanded="true">
#>       <i class="fas fa-angle-down dropdown-icon" role="presentation" aria-label="angle-down icon"></i>
#>       <label class="panel-title inline">Display</label>
#>     </div>
#>     <div class="panel-collapse collapse in" id="_panel_body_1023">
#>       <div class="panel-body">
#>         <div id="check" class="form-group shiny-input-checkboxgroup shiny-input-container" role="group" aria-labelledby="check-label">
#>           <label class="control-label" id="check-label" for="check">Tables display</label>
#>           <div class="shiny-options-group">
#>             <div class="checkbox">
#>               <label>
#>                 <input type="checkbox" name="check" value="A" checked="checked"/>
#>                 <span>A</span>
#>               </label>
#>             </div>
#>             <div class="checkbox">
#>               <label>
#>                 <input type="checkbox" name="check" value="B"/>
#>                 <span>B</span>
#>               </label>
#>             </div>
#>             <div class="checkbox">
#>               <label>
#>                 <input type="checkbox" name="check" value="C"/>
#>                 <span>C</span>
#>               </label>
#>             </div>
#>           </div>
#>         </div>
#>         <div id="radio" class="form-group shiny-input-radiogroup shiny-input-container" role="radiogroup" aria-labelledby="radio-label">
#>           <label class="control-label" id="radio-label" for="radio">Plot type</label>
#>           <div class="shiny-options-group">
#>             <div class="radio">
#>               <label>
#>                 <input type="radio" name="radio" value="a" checked="checked"/>
#>                 <span>a</span>
#>               </label>
#>             </div>
#>             <div class="radio">
#>               <label>
#>                 <input type="radio" name="radio" value="b"/>
#>                 <span>b</span>
#>               </label>
#>             </div>
#>           </div>
#>         </div>
#>       </div>
#>     </div>
#>   </div>
#> </div>