I would like to adjust the footer position in a shiny app. When the page content is shorter than the viewport, the footer should be at the bottom of the viewport. When the page content is longer than the viewport, the footer should be below the content. This post suggests how to usually implement it in CSS. This and similar solutions are commonly straightforward to use when writing the page's HTML code by hand.
There are discussions on footer positions in shiny and some of them manage to move the footer to the bottom. However, they fail to keep the footer from overlapping with the bottom of the page's main content, which requires shortening the main content's container.
Consider the following minimal working example:
library(shiny)
ui <- navbarPage(title = "Some Example", id = "example",
tabPanel(title = "Something", value = "something",
textOutput("some_text")
),
footer = "The footer."
)
server <- function(input, output, session) {
output$some_text <- renderText(stringi::stri_rand_lipsum(5))
}
shinyApp(ui = ui, server = server)