scrollable text box?

1,232 views
Skip to first unread message

Jamie Kass

unread,
Jun 1, 2015, 4:42:12 PM6/1/15
to shiny-...@googlegroups.com
I would like to add a status window on my shiny app that prints text but does not increase in height. The user should be able to scroll through the text. I know this is possible in HTML with something like <div style="overflow: auto ...">, but I can't figure out how to implement it in shiny. Any tips would be appreciated. Thanks.

Dean Attali

unread,
Jun 1, 2015, 6:24:27 PM6/1/15
to shiny-...@googlegroups.com
You can do the same thing by addind the `overflow: auto` to your app's CSS.

runApp(shinyApp(
  ui = fluidPage(
    shiny::tags$head(shiny::tags$style(shiny::HTML(
      "#text { font-size: 50px; height: 200px; overflow: auto; }"
    ))),
    div(id = "text", paste(names(tags), collapse = ", "))
  ),
  server = function(input, output, session) {
  }
))

Jamie Kass

unread,
Jun 4, 2015, 12:54:04 PM6/4/15
to shiny-...@googlegroups.com
Thank you! That works great.
Reply all
Reply to author
Forward
0 new messages