Git Product home page Git Product logo

Comments (6)

ismirsehregal avatar ismirsehregal commented on May 28, 2024 1

As this is not a {shinydashboard} issue I guess you are better off asking those questions here:

https://stackoverflow.com/questions/tagged/shiny

or here:

https://community.rstudio.com/c/shiny/8

but nevertheless, there you go:

library(shiny)
library(shinydashboard)
library(shinydashboardPlus)

shinyApp(
  ui = dashboardPage(
    header = dashboardHeader(),
    sidebar = dashboardSidebar(),
    body = dashboardBody(),
    footer = dashboardFooter(
      # with image
      left = a(target="_blank", href = 'https://www.google.com/',
               img(src = 'https://www.gstatic.com/images/branding/googlelogo/svg/googlelogo_clr_74x24px.svg', title = "visit google.com", height = "40px"),
               style = "padding-top:5px; padding-bottom:5px;"),
      # witout image:
      # left = a("Please look at the lower right corner", target="_blank", href = 'https://www.google.com/',
      #          style = "padding-top:5px; padding-bottom:5px;"),
      right = textOutput("somethinguseful")
    ),
    title = "DashboardPage"
  ),
  server = function(input, output, session) {
    output$somethinguseful <- renderText({
      invalidateLater(500)
      as.character(Sys.time())
    })
  }
)

from shinydashboard.

ismirsehregal avatar ismirsehregal commented on May 28, 2024

You might want to check shinydashboardPlus::dashboardFooter.

from shinydashboard.

BirongZhang avatar BirongZhang commented on May 28, 2024

You might want to check shinydashboardPlus::dashboardFooter.

Hi friend,

Thanks for your kind reply!

I also found this function before, shinydashboardPlus has very good example here, which is exactly what I want. But from this dashboardFooter tutorial, I can only add some simple text at the footer. I still don't know how to put the link behind the text and build a dynamic footer.

Is there any other advanced tutorials about this? Thanks.

Best regards,
Birong

from shinydashboard.

ismirsehregal avatar ismirsehregal commented on May 28, 2024

You are not limited to using text regarding those parameters. Please check the following:

library(shiny)
library(shinydashboard)
library(shinydashboardPlus)

shinyApp(
  ui = dashboardPage(
    header = dashboardHeader(),
    sidebar = dashboardSidebar(),
    body = dashboardBody(),
    footer = dashboardFooter(
      left = uiOutput("htmlout"),
      right = textOutput("somethinguseful")
    ),
    title = "DashboardPage"
  ),
  server = function(input, output, session) {
    output$htmlout <- renderUI({
      strong("Please look at the lower right corner")  
    })
    output$somethinguseful <- renderText({
      invalidateLater(500)
      as.character(Sys.time())
    })
  }
)

PS: of course you could also directly use an img tag instead of renderUI.

from shinydashboard.

BirongZhang avatar BirongZhang commented on May 28, 2024

Hi friend,

Thanks for your reply! It helps a lot!

I was wondering if you could show me how to put a link behind "Please look at the lower right corner". For example, I click on "Please look at the lower right corner", and then shiny can open a website page for me. That would be great!

Sorry for being so annoying. Thanks.

from shinydashboard.

BirongZhang avatar BirongZhang commented on May 28, 2024

As this is not a {shinydashboard} issue I guess you are better off asking those questions here:

https://stackoverflow.com/questions/tagged/shiny

or here:

https://community.rstudio.com/c/shiny/8

but nevertheless, there you go:

library(shiny)
library(shinydashboard)
library(shinydashboardPlus)

shinyApp(
  ui = dashboardPage(
    header = dashboardHeader(),
    sidebar = dashboardSidebar(),
    body = dashboardBody(),
    footer = dashboardFooter(
      # with image
      left = a(target="_blank", href = 'https://www.google.com/',
               img(src = 'https://www.gstatic.com/images/branding/googlelogo/svg/googlelogo_clr_74x24px.svg', title = "visit google.com", height = "40px"),
               style = "padding-top:5px; padding-bottom:5px;"),
      # witout image:
      # left = a("Please look at the lower right corner", target="_blank", href = 'https://www.google.com/',
      #          style = "padding-top:5px; padding-bottom:5px;"),
      right = textOutput("somethinguseful")
    ),
    title = "DashboardPage"
  ),
  server = function(input, output, session) {
    output$somethinguseful <- renderText({
      invalidateLater(500)
      as.character(Sys.time())
    })
  }
)

Many thanks! 👍

from shinydashboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.