Brilliant layout - how to add a footer dropout?

How do I add footer notes or disclaimers in Glittery User Interface? This is my current layout,

shinyUI(
  pageWithSidebar(

    headerPanel("My Title"),

    sidebarPanel("sidebar"),

    mainPanel("hello world")
)
)

      

I checked this page but didn't mention it. Any ideas?

What I need,

My Title

sidebar   hello world (plots)

----------------------------

      disclaimer

      

+3


source to share


1 answer


Here's an example for other Shiny

happy people to use.

Note that I have updated the above example to sidebarLayout

, as ?pageWithSidebar

help says:

pageWithSidebar - This function is deprecated. You must use fluidPage along with sidebarLayout to implement a sidebar page.

Basic example of a footer

I made an example of all in one style app.r

so people can test it, but if you have a file ui.R

, just add the line just before the call fluidPage

. I am using the horizontal rule (hr) just before the footer to highlight the footer, but that is up to you. I noticed it navbarPage

has a header and footer option that you can set.

# app.R
library(shiny)

ui<- shinyUI(
  fluidPage(title = "Footer example App",

    sidebarLayout(sidebarPanel("sidebar",
                               selectInput("pet", "Pet", 
                                           c("Cat", "Dog", "Fish"))
                  ),
                  mainPanel("hello world")
                  ),
    # WHERE YOUR FOOTER GOES
    hr(),
    print("~~~my disclaimer~~~~")
  )
)

server <- function(input, output) {
  # empty for minimal example
}

shinyApp(ui=ui, server = server)

      

Result



FooterInBrowser

Additional features using footer.html

I have my own footer.html file with CSS and logo. Place the footer.html file in the same location as your shiny files and use includeHTML

. I wrap a div so any css gets.

In the above example, replace the line:

    print("~~~my disclaimer~~~~")

      

FROM

    div(class = "footer",
        includeHTML("footer.html")
    ))

      

+4


source







All Articles