surveydown Gadgets for Page and Question Creation
A brief walkthrough of surveydown gadgets for creating pages and questions using RStudio.
As of version 0.10.0, surveydown now has shiny gadgets to make it easier to insert pages and questions into your survey.qmd file. This post highlights how to use them in your survey building workflow.
To view a full-course survey building workflow, proceed to the Basic Components page.
1 Introduction
While surveydown works with various IDEs, the gadget features perform best in RStudio. These gadgets provide a user-friendly interface for creating survey elements without having to remember the exact syntax or function parameters.
Two primary gadgets are offered by surveydown:
- Survey Page Gadget - Creates a new survey page
- Survey Question Gadget - Creates a new survey question
Here is a showcase of the Survey Page Gadget in RStudio:

The Survey Question Gadget:

As you can see, these gadgets simplify the process of adding survey components. This blog walks you through how to access and use these gadgets.
2 Accessing the Gadgets
The gadgets are powered by the sd_page_gadget()
and sd_question_gadget()
functions, but you don’t need to call these functions directly.
You can access these gadgets in RStudio in two ways:
2.2 Keyboard Shortcuts (Recommended)
For more efficient workflow, set up keyboard shortcuts:
- Go to Tools → Addins → Browse Addins…

- In the Addins popup window, click on the “Keyboard shortcuts…” button on the bottom left corner.

- Input “survey” in the search box.

- Assign the following shortcuts:
Ctrl+Shift+P
for the Survey Page GadgetCtrl+Shift+Q
for the Survey Question Gadget
3 Using the Gadgets
3.1 Survey Page Gadget

The page gadget is straightforward:
- Press
Ctrl+Shift+P
(or use the Addins menu) - Enter a Page ID (no spaces allowed)
- Click “Create Page” or press Enter
This will insert a properly formatted page block at your cursor position, including an R code chunk ready for adding questions.
3.2 Survey Question Gadget

The question gadget offers more options:
- Press
Ctrl+Shift+Q
(or use the Addins menu) - Fill in the following:
- Question Type: Select from the dropdown (default is “Multiple Choice”)
- Question ID: Enter a unique identifier (no spaces)
- Question Label: Enter the actual question text
- R Chunk Option: Check this box if you need the question to be inserted within an R code chunk
- Click “Create Question” or press Enter
Note that if you created the question inside an existing page’s R chunk, you don’t need to check the “R Chunk Option”. If you’re adding a question elsewhere and need it to be in an R chunk, check that box.
4 Example Workflow
Here’s how a typical workflow might look:
- Create a new page:
- Press
Ctrl+Shift+P
- Key in your Page ID
- Press Enter
- Press
- Add a question:
- Press
Ctrl+Shift+Q
- Select your desired question type
- Key in your Question ID
- Key in your Question Label
- Press Enter
- Modify your Question Options as needed
- Press
- Add more questions as needed by repeating step 2.
By following these steps and using the gadgets, you’ll create well-structured surveys much faster than coding everything manually.