twTextAreaInput {shiny.tailwind}R Documentation

Wrapper around shiny::textAreaInput() but allowing for more classes

Description

Wrapper around shiny::textAreaInput() but allowing for more classes

Usage

twTextAreaInput(
  inputId,
  label,
  value = "",
  placeholder = NULL,
  width = NULL,
  height = NULL,
  rows = NULL,
  cols = NULL,
  resize = NULL,
  container_class = NULL,
  label_class = NULL,
  input_class = NULL,
  label_after_input = FALSE
)

Arguments

inputId

The input slot that will be used to access the value.

label

Display label for the control, or NULL for no label.

value

Initial value.

placeholder

A character string giving the user a hint as to what can be entered into the control. Internet Explorer 8 and 9 do not support this option.

width

The width of the input, e.g. '400px', or '100%'; see validateCssUnit().

height

The height of the input, e.g. '400px', or '100%'; see validateCssUnit().

rows

The value of the visible character rows of the input, e.g. 6. If the height argument is specified, height will take precedence in the browser's rendering.

cols

Value of the visible character columns of the input, e.g. 80. This argument will only take effect if there is not a CSS width rule defined for this element; such a rule could come from the width argument of this function or from a containing page layout such as fluidPage().

resize

Which directions the textarea box can be resized. Can be one of "both", "none", "vertical", and "horizontal". The default, NULL, will use the client browser's default setting for resizing textareas.

container_class

additional classes to be applied to the container

label_class

additional classes to be applied to the label

input_class

additional classes to be applied to the input element

label_after_input

TRUE/FALSE if the label should be put after the input box. Default is FALSE. Useful for special cases (floating labels), c.f. 04-shiny-inputs example app.

Value

a list with a shiny.tag class

See Also

shiny::textAreaInput()

Examples

shiny::textAreaInput("id", "Label",
  value = "The value", width = "200px",
  placeholder = "Placeholder"
)
twTextAreaInput("id", "Label",
  value = "The value", width = "200px",
  height = "200px", placeholder = "Placeholder",
  container_class = "CONTAINER", label_class = "LABEL", input_class = "INPUT"
)

# basic full shiny example
library(shiny)

ui <- fluidPage(
  use_tailwind(),
  twTextAreaInput(
    "text", "A Text",
    placeholder = "Here goes a placeholder",
    width = "400px", height = "400px",
    # Apply tailwind classes
    container_class = "w-48 m-4 p-2 border border-gray-200 rounded-md drop-shadow-md",
    label_class = "font-serif text-gray-600",
    input_class = "drop-shadow-lg font-mono text-gray-600 rounded-md border-amber-400"
  ),
  verbatimTextOutput("value")
)

server <- function(input, output) {
  output$value <- renderText(input$text)
}

if (interactive()) shiny::shinyApp(ui_basic, server)

[Package shiny.tailwind version 0.2.2 Index]