textInput: Create an advanced text input

View source: R/form.R

textInputR Documentation

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
)

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

Value

A HTML with modifications to th style information

Note

For more information on the features of the form, visit the examples section of the help documentation

Examples


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) {
    }
  )
}



nextGenShinyApps documentation built on Sept. 11, 2024, 7:38 p.m.