Learn R Programming

nextGenShinyApps (version 2.1)

textInput: Create an advanced text input

Description

Modifications to textInput to allow added functionality and styles

Usage

textInput(
  inputId,
  label,
  value = "",
  width = NULL,
  placeholder = NULL,
  size = c("m", "s", "l", "xl"),
  style = c("default", "pill", "round", "clean"),
  border.type = c("none", "primary", "secondary", "info", "success", "danger", "warning"),
  prepend = NULL,
  append = NULL,
  disabled = FALSE
)

Value

A HTML with modifications to th style information

Arguments

inputId

The identification name

label

The label for the input

value

The current value of the input

width

width of the text input

placeholder

A placeholder text

size

The size of the input, "m", "s", "l", "xl"

style

Style to adapt, options include "default", "pill", "round", "clean"

border.type

Add a border coloring using either of "none", "primary","secondary", "info", "success", "danger", "warning"

prepend

Add a prepended text or icon

append

Add an appended text or icon

disabled

Boolean. If textInput should be disabled

Examples

Run this code
# \donttest{
if (interactive()) {
  library(shiny)
  library(nextGenShinyApps)

  shiny::shinyApp(
    ui = fluidPage(
      style = "8",
      custom.bg.color = "white",
      sidebar = NULL,
      header = NULL,
      card(
        header = FALSE,
        tags$h3("Text input"),
        textInput("caption", "Basic"),
        textInput("caption", "Basic", style = "clean"),
        textInput("caption", "Border - primary",
          "Enter sample text",
          prepend = "@", border.type = "info"
        ),
        textInput("caption", "Border - primary",
          "Enter sample text",
          prepend = shiny::icon("lock")
        ),
        textInput("caption", "Border - primary",
          "Enter sample text",
          append = "%"
        ),
        textInput("caption", "Border - primary",
          "Enter sample text",
          prepend = shiny::icon("chart"),
          append = ".00"
        )
      )
    ),
    server = function(input, output) {
    }
  )
}
# }

Run the code above in your browser using DataLab