You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
584B

  1. library(shiny)
  2. typingSpeedInput <- function(inputId, label, placeholder = NULL) {
  3. .label <- label
  4. htmltools::withTags(
  5. div(
  6. class = "form-group typing-speed",
  7. label(class = "control-label", `for` = inputId, .label),
  8. textarea(id = inputId, class = "form-control", placeholder = placeholder)
  9. )
  10. )
  11. }
  12. ui <- fluidPage(
  13. # textAreaInput("typing", "Type here..."),
  14. typingSpeedInput("typing", "Type here..."),
  15. verbatimTextOutput("debug")
  16. )
  17. server <- function(input, output, session) {
  18. output$debug <- renderPrint(input$typing)
  19. }
  20. shinyApp(ui, server)