Create a text input control with icon(s)
Extend form controls by adding text or icons before,
after, or on both sides of a classic textInput
.
textInputIcon( inputId, label, value = "", placeholder = NULL, icon = NULL, size = NULL, width = NULL )
inputId |
The |
label |
Display label for the control, or |
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. |
icon |
An |
size |
Size of the input, default to |
width |
The width of the input, e.g. |
A text input control that can be added to a UI definition.
if (interactive()) { library(shiny) library(shinyWidgets) ui <- fluidPage( tags$h2("textInputIcon examples"), fluidRow( column( width = 6, textInputIcon( inputId = "ex1", label = "With an icon", icon = icon("user-circle-o") ), verbatimTextOutput("res1"), textInputIcon( inputId = "ex2", label = "With an icon (right)", icon = list(NULL, icon("user-circle-o")) ), verbatimTextOutput("res2"), textInputIcon( inputId = "ex3", label = "With text", icon = list("https://") ), verbatimTextOutput("res3"), textInputIcon( inputId = "ex4", label = "Both side", icon = list(icon("envelope"), "@mail.com") ), verbatimTextOutput("res4"), textInputIcon( inputId = "ex5", label = "Sizing", icon = list(icon("envelope"), "@mail.com"), size = "lg" ), verbatimTextOutput("res5") ) ) ) server <- function(input, output, session) { output$res1 <- renderPrint(input$ex1) output$res2 <- renderPrint(input$ex2) output$res3 <- renderPrint(input$ex3) output$res4 <- renderPrint(input$ex4) output$res5 <- renderPrint(input$ex5) } shinyApp(ui, server) }
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.