Rstudio shiny collapsible sidePanel

r, shiny

Solution

Only a partial solution but ... if you wrap the div below around the content or your sidebarPanel

div(id = "demo", class = "collapse in", 

)

and then put a button in your main panel as follows

HTML("<button type='button' class='btn btn-danger' data-toggle='collapse' data-target='#demo'>simple collapsible</button>"),

you can collapse the content of the sidebarPanel. This doesn't expand the main panel to take up all the screen however.

Problem

I want to maximise the usable screen width of the `mainPanel` for an Rstudio shiny webpage. In my webpage, the `sidePanel` is used to select parameters to visualise the results in the `mainPanel`. I would like to know what can I do to maximise the usable space in `mainPanel`. For example, I would like to have a "collapse/expand" option for the `sidePanel`, so that when collapsed, the entire width of the window is used by `mainPanel`. Any ideas? EDITED: It turns out `sidePanel` is a bit tricky, but I can do two different `bootstrapPage`, and have the one on top for selections that affect the one in the bottom. Then have a collapsible button for it. I'll turn it into an answer unless someone has a more elegant one.

Original source