Learn R Programming

shiny.blueprint (version 0.3.0)

EditableText: Editable text

Description

Documentation: https://blueprintjs.com/docs/#core/components/editable-text

Usage

EditableText(...)

EditableText.shinyInput(inputId, ..., value = defaultValue)

Value

Object with shiny.tag class suitable for use in the UI of a Shiny app.

Arguments

...

Component props and children. See the official Blueprint docs for details.

inputId

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

value

Initial value.

Examples

Run this code
library(shiny.blueprint)
library(shiny)

ui <- function(id) {
  ns <- NS(id)
  tagList(
    H2(EditableText(onChange = setInput(ns("header")))),
    EditableText.shinyInput(
      inputId = ns("body"),
      multiline = TRUE,
      minLines = 3, maxLines = 12
    ),
    textOutput(ns("headerValue")),
    textOutput(ns("bodyValue"))
  )
}

server <- function(id) {
  moduleServer(id, function(input, output, session) {
    output$headerValue <- renderText(paste("Header:", deparse(input$header)))
    output$bodyValue <- renderText(paste("Body:", deparse(input$body)))
  })
}

if (interactive()) shinyApp(ui("app"), function(input, output) server("app"))

Run the code above in your browser using DataLab