I am building a multipage shiny application - that is, the application consists of several (independent) main pages with buttons to go forward and (sometimes) backwards. As far as I can see - and in line with the general two possibilities to build a shiny app -, there are two main approaches
- Build the pages in the userinterface (ui.R), then hide and show each pages accordingly. This is the approach followed by @daattali in this demonstration app, usingshinyjsto hide and show each page. I suppose there could also be ways to do this by usingnavbar(),navlist()ortabsetPanel(), if one can hide the navigation bar oder navigation list. This has the advantage of updating pages simply viaupdateTabsetPanel(),updateNavbarPage()orupdateNavlistPabel(), renderingshinyjsunneccesary.
- Second approach is to build the pages on the serverside with renderUI()and limitingui.Rto a stub. This is the approach followed for example by TomW, limiting ui torenderUI()and doing everything else server side; and the approach treated in this discussion
So my question is:
What are the advantages and disadvantages of each approach respectively what are situations where you should or should not use each approach?
I will provide an answer as to what I know at the moment, but would be glad of corrections and additions.
