Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding HTML elements over the login box created by secure_app #128

Open
lefterisKl opened this issue Dec 2, 2021 · 1 comment
Open

Adding HTML elements over the login box created by secure_app #128

lefterisKl opened this issue Dec 2, 2021 · 1 comment

Comments

@lefterisKl
Copy link

I would like to place a header tag (e.g. <h3> ) above the login box created by secure_app. I have tried the tags_top parameter but it places the header inside the borders of the login box:

secure_app(ui,          
  tags_top = tags$div(tags$h3("Some title"))) #places the title inside the login box
@lefterisKl lefterisKl changed the title Adding HTML elements of secure app Adding HTML elements over the login box created by secure_app Dec 2, 2021
@pvictor
Copy link
Collaborator

pvictor commented Dec 7, 2021

There's no option to do that, but you can still use an insertUI to put elements you want ino the page, e.g. :

library(shiny)
library(shinymanager)

ui <- secure_app(ui = fluidPage("Hello !"))

server <- function(input, output) {
  
  insertUI(
    selector = ".panel-auth", # target the fixed panel taking the whole page
    where = "afterBegin", 
    ui = tags$h1("HELLO!", class = "text-center")
  )

  secure_server(check_credentials(data.frame(
    user = "demo",
    password = "pass",
    stringsAsFactors = FALSE
  )))
}

shinyApp(ui = ui, server = server)

Victor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants