title: R Shiny - Resizing the MainPanel window when I minimize the sidebarPanel
body: <p>I built a Shiny application that has a fluidPage and a layout using the sidebarPanel and mainPanel. Right now I am using a button that minimizes the sidebarPanel but when that happens the mainPanel retains its width. What I would like to happen is the mainPanel adjusts to the new screen size and use the entire window instead of keeping the originall 66% it normally uses.</p>
  
  <p>This is the button event that I am using in the server.r file:</p>
  
  <pre><code>observeEvent(input$showpanel, {
  
  if(input$showpanel == TRUE) {
  
  shinyjs::show(id = "Sidebar")
  shinyjs::enable(id = "Sidebar")
  }
  else {
  
    shinyjs::hide(id = "Sidebar")
  }
  })
  </code></pre>
  
  <p>This is the button I am using in the ui.r file that is currently on the top of the mainPanel window.</p>
  
  <pre><code>mainPanel(
    bsButton("showpanel", "Show/hide sidebar", type = "toggle", value = TRUE),
  </code></pre>
  
  <p>Don't know if there's a way to add css or HTML to the mainPanel window when I hide the sidebarPanel.</p>