I am creating a Shiny App, where in one part I need the user to input a text summary, but the default size of text input box appearing in the App is very small. difficult for users to enter a summary of 3-4 lines. Could you help me with the script that can make the text input box bigger. really appreciate your help!

=========== I just tried the following with HTML tags:
library(shiny)
shinyUI(fluidPage(
sidebarLayout(
sidebarPanel(
tags$textarea(id="my_textarea", rows=5, "Leave a comment...")
),
mainPanel(
uiOutput("my_output")
)
)
))
but got some error - shown below!
Try using textAreaInput instead of textInput. With the former you can set height and width, and it automatically will wrap to next line if line is too long.
This seems to be a duplicate of this question; Multi line text inputs in shiny
I made a small aesthetic change(css to 100%), but it does work as it is. The error might be from some other section of your code. See the example below.
library(shiny)
ui<-shinyUI(fluidPage(
sidebarLayout(
sidebarPanel(
tags$style(type="text/css", "textarea {width:100%}") ,
tags$textarea(id="my_textarea", rows=5,placeholder = "Leave a comment...", "")
)
,mainPanel( h4('My panel') )
)
))
server <- shinyServer(function(input, output) {})
shinyApp(ui, server)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With