Modern forms & surveys for R and Shiny, powered by SurveyJS v2.x.
Build fully interactive forms, quizzes, and data entry apps in R—using
SurveyJS’s rich features, themes, and multilingual support.
Ready for everything from simple feedback to research-grade forms.
remotes::install_github("Tazinho/rsurveyjs")
# (CRAN release coming soon)- Render any SurveyJS survey from R lists—no manual JSON needed
- Built-in & custom themes with CSS variables; multilingual UI out of the box
- Seamless Shiny integration:
- Capture complete or live-updating survey responses
- Dynamically update forms, pre-fill data, or localize at runtime
 
- Power users: inject JavaScript for validation, custom logic, and events
- 
Survey Schema Recipes 
 All core question types, logic, validation—copy, adapt, and build fast.
- 
Themes, Styling and Localization 
 Make it beautiful and accessible for any audience.
- 
Advanced JS Hooks & Events 
 Add custom validation, interactivity, and logic with JavaScript hooks.
- 
Shiny and Database Integration 
 Save responses, restore sessions, and work with databases in production apps.
library(rsurveyjs)
surveyjs(
  schema = list(
    title = "Feedback",
    questions = list(
      list(type = "rating", name = "satisfaction", title = "How satisfied are you?"),
      list(type = "text", name = "comment", title = "Any comments?")
    )
  ),
  theme = "modern",
  theme_vars = list("--sjs-primary-backcolor" = "#39f"),
  locale = "en",
  live = TRUE
)See more: vignette(“survey-schema-recipes”)
| Feature | Shiny Input ID | 
|---|---|
| Completed form data | input$<id>_data | 
| Live updates (typing) | input$<id>_data_live | 
See Shiny and Database Integration for advanced use.
- No R-side validation:
- Schema validation and error handling is performed in the browser by SurveyJS itself.
 
- Custom widgets/plugins:
- Official support for registering new question types from R is not included.
- Power users can inject JavaScript via pre_render_hookand related arguments.
 See the Advanced JS Hooks & Events vignette.
 
- File uploads, Survey Creator, PDF export:
- Not included, but see the vignettes and SurveyJS docs for guidance and alternatives.
 
Advanced: Custom JavaScript and Custom Widgets
- rsurveyjs allows you to inject any JavaScript code via
pre_render_hook,post_render_hook, andcomplete_hook.- Advanced users can use these hooks to register SurveyJS custom widgets or plugins, add event listeners, or extend survey logic—provided you are familiar with the SurveyJS JavaScript API.
- Note: There is currently no high-level R API for defining or registering new question types from R code alone.
Custom widget support is available for power users only, via JavaScript hooks.- For real-world JS examples, see the Advanced JS Hooks & Events vignette.
Custom JavaScript hooks (pre_render_hook, post_render_hook,
complete_hook) allow you to inject JavaScript code into the SurveyJS
widget from R.
This is standard for trusted/internal use, but please be aware that any
code supplied will be executed in the user’s browser.
If your app is public or multi-user, only use this feature for users you
fully trust.
| Feature | SurveyJS | rsurveyjs | Notes | 
|---|---|---|---|
| JSON-based survey schema | ✅ | ✅ | List/JSON via schema= | 
| Multi-page, logic, validation | ✅ | ✅ | All schema features | 
| Themes & theme variables | ✅ | ✅ | Use theme,theme_vars | 
| Localization / i18n | ✅ | ✅ | locale =+ translations | 
| Read-only mode | ✅ | ✅ | read_only = TRUE | 
| Live response capture (Shiny) | ✅ | ✅ | input$<id>_data_live | 
| JS hooks & events | ✅ | ✅ | Pre/post/complete hooks | 
| PDF export, designer, file uploads | ✅ | ❌ | See SurveyJS docs/FAQ | 
Feedback, bug reports, and pull requests welcome!
File an issue or
contribute via PR.
SurveyJS Form Library and rsurveyjs are both MIT licensed.
Note: SurveyJS Creator/Designer is not included due to licensing.