Learn R Programming

spsComps (version 0.3.3.0)

clearableTextInput: A clearable text inputInput control

Description

An UI component with a "X" button in the end to clear the entire entered text. It works the same as Textinput.

Usage

clearableTextInput(
  inputId,
  label = "",
  value = "",
  placeholder = "",
  style = "width: 100%;"
)

Value

a shiny component

Arguments

inputId

ID

label

text label above

value

default value

placeholder

place holder text when value is empty

style

additional CSS styles you want to apply

Examples

Run this code
if(interactive()){

    ui <- fluidPage(
        clearableTextInput("input1", "This is a input box", style = "width: 50%;"),
        verbatimTextOutput("out1")
    )

    server <- function(input, output, session) {
        output$out1 <- renderPrint(input$input1)
    }

    shinyApp(ui, server)
}

Run the code above in your browser using DataLab