Description Usage Arguments Examples
This creates a default file input using Semantic UI. The input is available
under input[[input_id]]
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
input_id, inputId |
Input name. Reactive value is available under |
label |
Display label for the control, or NULL for no label. |
multiple |
Whether the user should be allowed to select and upload multiple files at once. |
accept |
A character vector of "unique file type specifiers" which gives the browser a hint as to the type of file the server expects. Many browsers use this prevent the user from selecting an invalid file. |
button_label, buttonLabel |
Display label for the button. |
type |
Input type specifying class attached to input container. See [Fomantic UI](https://fomantic-ui.com/collections/form.html) for details. |
placeholder |
Inner input label displayed when no file has been uploaded. |
... |
Other parameters passed from |
width |
The width of the input, e.g. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ## Only run examples in interactive R sessions
if (interactive()) {
library(shiny)
library(shiny.semantic)
ui <- semanticPage(
form(
div(
class = "ui grid",
div(
class = "four wide column",
file_input("ex", "Select file"),
header("File type selected:", textOutput("ex_file"))
)
)
)
)
server <- function(input, output, session) {
output$ex_file <- renderText({
if (is.null(input)) return("No file uploaded")
tools::file_ext(input$ex$datapath)
})
}
shinyApp(ui, server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.