How to create TextArea as input in a Shiny webapp in R?

前端 未结 6 2110
春和景丽
春和景丽 2020-12-13 00:47

I am trying to create simple webapp where I want to take in multiline input from user using HTML textarea control. Is there any out of the box way of creating such an input

6条回答
  •  醉话见心
    2020-12-13 01:24

    Here's a quick solution that preserves the shiny input feel, but allows custom number of columns:

    textareaInput <- function(inputID, label, value="", rows=10, columns=80) {
      HTML(paste0('
    ')) }

    In your ui.R script, you can add:

    textareaInput("shazam", "My text box")


    Note: To get a Bootstrap feel to the textarea, you can use:

    textareaInput <- function(inputID, label, value="", rows=10) {
      HTML(paste0('
    ')) }

提交回复
热议问题