Description Usage Arguments Examples
Define simple date input with Semantic UI styling
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
input_id |
Input id. |
label |
Label to be displayed with date input. |
value |
Default date chosen for input. |
min |
Minimum date that can be selected. |
max |
Maximum date that can be selected. |
style |
Css style for widget. |
icon_name |
Icon that should be displayed on widget. |
inputId |
Input id. |
icon |
Icon that should be displayed on widget. |
width |
character width of the object |
... |
other arguments |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | if (interactive()) {
# Below example shows how to implement simple date range input using \code{date_input}
library(shiny)
library(shiny.semantic)
ui <- shinyUI(
semanticPage(
title = "Date range example",
uiOutput("date_range"),
p("Selected dates:"),
textOutput("selected_dates")
)
)
server <- shinyServer(function(input, output, session) {
output$date_range <- renderUI({
tagList(
tags$div(tags$div(HTML("From")),
date_input("date_from", value = Sys.Date() - 30, style = "width: 10%;")),
tags$div(tags$div(HTML("To")),
date_input("date_to", value = Sys.Date(), style = "width: 10%;"))
)
})
output$selected_dates <- renderPrint({
c(input$date_from, input$date_to)
})
})
shinyApp(ui = ui, server = server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.