Ask the assistant to build the renderer
You do not need to write the component yourself. In the Assistant panel, name the question and describe:- What the participant sees and does.
- Which earlier answers the interaction needs.
- What value the question must store.
- The condition that makes the answer complete.
- Any mobile, translation, or accessibility requirement.
On “Choose your cold-coffee budget for next month,” create a custom interface that starts from the earlier monthly-spend answer. Increase or decrease it in €5 steps, show the current amount at all times, and store one numeric answer. The participant can continue after selecting an amount between €0 and €150. Keep it usable on mobile.After the assistant updates the form, open the renderer and complete the preview checks below before saving the questionnaire.
Open the renderer editor
Open the question’s ⋯ menu and select Custom-built question. If the question already uses one, select Edit in its custom-question strip. Test in that strip opens a participant test of the question; it does not open the editor preview.
Open Custom-built question from the question menu; the underlying question type remains unchanged.

Preview runs the same sandboxed component used in the participant survey and shows whether its answer has the expected shape.
Edit the component
Select Edit code to open the TSX editor. Select Back to preview to return to the interaction. It must export one React component. Imports are limited toreact and @deepfield/question-kit.
The question kit provides the question definition, declared earlier answers, translatable parameters, locale, current answer, and answer controls:

The Code view includes the source editor, compile feedback, and a coding guide for the current question contract.
Match the answer contract
setAnswer must use the value shape of the underlying type:
question.options and question.matrix_rows. setValid(false, message) keeps Next unavailable and can show the participant what remains to be completed. The server validates the submitted value and the question’s configured validation rules.
The current answer already contains restored progress. Use it as the submitted state so a participant who reloads can see and change the saved answer.
For a currency question, call setCurrency("EUR") (or the selected currency code) as well as setAnswer(...). A numeric value alone does not pass the preview’s currency check.
Add earlier answers and translatable text
Open Advanced — inputs & text.- Inputs declares earlier questions. The renderer can access only those selected inputs.
- Text shown to participants stores named values that enter the standard translation workflow. Keys must be unique and non-empty.
- Preview text in switches among available runtime locales.
- Sample inputs lets you test Answered, Unanswered, and Skipped states for each declared input.

Declare the earlier spend question and give each participant text a unique key.
Test and save the renderer
Before selecting Save renderer:- Complete the Preview with typical, boundary, and incomplete values.
- Test each state of every earlier-answer input.
- Switch the preview locale when the study is multilingual.
- Confirm the answer status matches the underlying type.
- Save the renderer, then save the questionnaire.
- Open a test link and repeat the task on desktop and mobile widths.
- Reload during the task and confirm the saved answer is restored correctly.

The preview accepts the 35-euro numeric answer and its currency.

The participant starts from the earlier 30-euro answer and can increase it to 35 euros.
Understand analysis and export behavior
Charts read the typed answer defined by the question type. Analysis shows a notice when a question uses custom code because the chart may not represent every detail of the interaction. The response Excel workbook and raw CSV export add a[raw] column for each custom-code question. It contains the exact stored value, including additional keys that do not appear in the type-specific columns.

Open the saved answer in Responses: this custom interface stored the number 35.
Return to the built-in interface
Open the renderer and select Remove — use the built-in renderer. Save the questionnaire. The question keeps its wording, type, options, and standard settings, but participants return to the built-in answer interface.Troubleshoot a renderer
The code does not compile
The code does not compile
react or @deepfield/question-kit.The preview answer does not match the question
The preview answer does not match the question
An earlier answer is missing
An earlier answer is missing
The participant cannot continue
The participant cannot continue
setValid, then test the same value in Preview. Confirm that the answer also passes any native Answer validation rule on the question.The editor loads as plain text
The editor loads as plain text
