Description Usage Arguments Value Examples
Include server-side logic for shinysurveys.
1 | renderSurvey(df, theme = "#63B8FF")
|
df |
Deprecated please only place argument in
|
theme |
Deprecated please place the theme argument in
|
NA; used for server-side logic in Shiny apps.
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 33 | if (interactive()) {
library(shiny)
library(shinysurveys)
df <- data.frame(question = "What is your favorite food?",
option = "Your Answer",
input_type = "text",
input_id = "favorite_food",
dependence = NA,
dependence_value = NA,
required = F)
ui <- fluidPage(
surveyOutput(df = df,
survey_title = "Hello, World!",
theme = "#63B8FF")
)
server <- function(input, output, session) {
renderSurvey()
observeEvent(input$submit, {
showModal(modalDialog(
title = "Congrats, you completed your first shinysurvey!",
"You can customize what actions happen when a user finishes a survey using input$submit."
))
})
}
shinyApp(ui, server)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.