shiny::fileInput("id", "label",
multiple = TRUE, accept = c(".csv", ".rds"),
width = "200px", buttonLabel = "Upload", placeholder = "Here"
)
twFileInput("id", "label",
multiple = TRUE, accept = c(".csv", ".rds"),
width = "200px", buttonLabel = "Upload", placeholder = "Here",
container_class = "CONTAINER", label_class = "LABEL",
select_class = "SELECT"
)
# basic full shiny example
library(shiny)
ui <- fluidPage(
use_tailwind(),
twFileInput(
inputId = "file", label = "Upload", multiple = TRUE,
buttonLabel = "Upload", placeholder = "Nothing selected",
container_class = "shadow-md rounded-md bg-gray-50 m-2 p-2 w-96",
label_class = "font-serif text-red-800",
select_class = "font-mono font-bold text-red-800 rounded-r-lg",
button_class = paste(
"bg-red-800 border-red-800 hover:bg-red-700",
"hover:border-red-700 text-white hover:text-gray-50"
),
progress_class = "bg-red-800"
),
verbatimTextOutput("data")
)
server <- function(input, output) {
output$data <- renderText({
paste(capture.output(str(input$file)), collapse = "\n")
})
}
if (interactive()) shiny::shinyApp(ui, server)
Run the code above in your browser using DataLab