EVOLUTION-MANAGER
Edit File: Collapses.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Collapses</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for Collapses {shinyBS}"><tr><td>Collapses {shinyBS}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Collapses</h2> <h3>Description</h3> <p>Collapse panels allow you to reduce clutter in your Shiny app by making panels of information that open and close with a user's click. Any type of content can go in a collapse panel. Standard Bootstrap styling options are available. </p> <h3>Details</h3> <p>Collapses are designed to mimic <code><a href="../../shiny/html/tabsetPanel.html">tabsetPanel</a></code> in their implementation. Start with <code>bsCollapse</code> to create a panel group, then fill it with panels using <code>bsCollapsePanel</code>. </p> <p><code>bsCollapse</code> acts as an input, so you can retrieve which panels are open from the input object passed to the function in <code><a href="../../shiny/html/shinyServer.html">shinyServer</a></code>. </p> <p><code>updateCollapse</code> can be used within your server logic to open/close collapse panels or to change their style. </p> <h3>Components</h3> <dl> <dt><code><a href="bsCollapse.html">bsCollapse</a></code></dt><dd><p>A container for holder the individual panels created by <code><a href="bsCollapsePanel.html">bsCollapsePanel</a></code>.</p> </dd> <dt><code><a href="bsCollapsePanel.html">bsCollapsePanel</a></code></dt><dd><p>Creates an individual Collapse Panel that resides within a <code><a href="bsCollapse.html">bsCollapse</a></code>.</p> </dd> <dt><code><a href="updateCollapse.html">updateCollapse</a></code></dt><dd><p>Used within your server logic to open/close collapse panels or change their style.</p> </dd> </dl> <h3>Changes</h3> <p><code>style</code> is a new option that wasn't available in previous versions of shinyBS. </p> <h3>Note</h3> <p>Run <code>bsExample("Collapses")</code> for an example of <code>Collapses</code> functionality. </p> <h3>See Also</h3> <p><a href="http://getbootstrap.com">Twitter Bootstrap 3</a> </p> <p>Other Collapses: <code><a href="bsCollapsePanel.html">bsCollapsePanel</a></code>; <code><a href="bsCollapse.html">bsCollapse</a></code>; <code><a href="updateCollapse.html">updateCollapse</a></code> </p> <h3>Examples</h3> <pre> library(shiny) library(shinyBS) app = shinyApp( ui = fluidPage( sidebarLayout( sidebarPanel(HTML("This button will open Panel 1 using <code>updateCollapse</code>."), actionButton("p1Button", "Push Me!"), selectInput("styleSelect", "Select style for Panel 1", c("default", "primary", "danger", "warning", "info", "success")) ), mainPanel( bsCollapse(id = "collapseExample", open = "Panel 2", bsCollapsePanel("Panel 1", "This is a panel with just text ", "and has the default style. You can change the style in ", "the sidebar.", style = "info"), bsCollapsePanel("Panel 2", "This panel has a generic plot. ", "and a 'success' style.", plotOutput("genericPlot"), style = "success") ) ) ) ), server = function(input, output, session) { output$genericPlot <- renderPlot(plot(rnorm(100))) observeEvent(input$p1Button, ({ updateCollapse(session, "collapseExample", open = "Panel 1") })) observeEvent(input$styleSelect, ({ updateCollapse(session, "collapseExample", style = list("Panel 1" = input$styleSelect)) })) } ) ## Not run: runApp(app) ## End(Not run) </pre> <hr /><div style="text-align: center;">[Package <em>shinyBS</em> version 0.61.1 <a href="00Index.html">Index</a>]</div> </body></html>