Widgets

Widgets answer types are small user interface modules that runs client side on the browser and that can be build using javascript, css and html.

Using widget you can fully extend ngSurvey with your own functionalities as you can develop any kind of functionality that you would be normally be able to do using plain javascript, css and html.

Widgets can be divided into 2 categories

  • Selection widgets are providing a functionality related to the selection of an answer like for example a radio button and when used in a question will set its current selected answer value. In the example below we developed a small widget that replaces the out of the box radio button selection answer type with a more fancy alternative.

  • Value widgets are providing a value that will be saved along respondents answers. In the example below we integrate a third party javascript calendar component that already existed on the market.

While developing widget you may use the propertysDef property of your widget to define custom properties that you can use in your code and let the survey manager set their values dynamically from the answer properties page.

🔅 Widget development

Widgets can be developed and tested using the answer type editor user interface. Using the Widget preview / test feature we can see in real-time how our new widget would look like if it was used within a survey.

Last updated

(c) 2024 Data Illusion Zumbrunn. All rights reserved. Reproduction strictly forbidden.