shiny::textInput(
"id", "Label",
value = "The value", width = "200px",
placeholder = "Placeholder"
)
twTextInput(
"id", "Label",
value = "The value", width = "200px",
placeholder = "Placeholder", type = "email",
container_class = "CONTAINER", label_class = "LABEL",
input_class = "INPUT"
)
# basic full shiny example
library(shiny)
# basic example
ui <- fluidPage(
use_tailwind(),
div(
class = "flex flex-wrap",
twTextInput(
"text", "A Text",
type = "text", placeholder = "Some Text",
# Apply tailwind classes
container_class = paste(
"w-48 m-4 p-2 border border-gray-200",
"rounded-md drop-shadow-md"
),
label_class = "font-serif text-gray-600",
input_class = paste(
"drop-shadow-lg font-mono text-gray-600",
"rounded-md border-amber-400"
)
),
twTextInput(
"email", "An Email",
type = "email",
placeholder = "email",
# Apply tailwind classes
container_class = paste(
"w-48 m-4 p-2 border border-gray-200",
"rounded-md drop-shadow-md"
),
label_class = "font-serif text-gray-600",
input_class = paste(
"drop-shadow-lg font-mono text-gray-600",
"rounded-md border-amber-400"
)
),
twTextInput(
"pw", "A Password",
type = "password",
placeholder = "dont let it be password",
# Apply tailwind classes
container_class = paste(
"w-48 m-4 p-2 border border-gray-200",
"rounded-md drop-shadow-md"
),
label_class = "font-serif text-gray-600",
input_class = paste(
"drop-shadow-lg font-mono text-gray-600",
"rounded-md border-amber-400"
)
)
),
twTextInput(
"pw", "A Password",
type = "password", placeholder = "dont let it be password",
# Apply tailwind classes
container_class = "w-48 m-4 p-2 border border-gray-200 rounded-md drop-shadow-md",
label_class = "font-serif text-gray-600",
input_class = "drop-shadow-lg font-mono text-gray-600 rounded-md border-amber-400"
),
verbatimTextOutput("value")
)
server <- function(input, output) {
output$value <- renderText({
paste(capture.output(str(list(
text = input$text,
email = input$email,
pw = input$pw
))), collapse = "\n")
})
}
if (interactive()) shiny::shinyApp(ui, server)
Run the code above in your browser using DataLab