Cart Licenses Contact Support Online Creator Log in/Register
v 1.9.51

Dropdown with Custom Item Template


                    var json = {
  "elements": [
      "type": "dropdown",
      "name": "car",
      "title": "What car are you driving?",
      "itemComponent": "new-item",
      "isRequired": true,
      "choices": [ "Ford", "Vauxhall", "Volkswagen", "Nissan", "Audi", "Mercedes-Benz", "BMW", "Peugeot", "Toyota", "Citroen" ]

                    window.survey = new Survey.Model(json);
            survey.onComplete.add(function(sender) {
            document.querySelector('#surveyResult').textContent =
            "Result JSON:\n" + JSON.stringify(, null, 3);
Vue.component("new-item", {
    props: {
        item: {},
    created: function () {
        const item = this.item;
        item.logoUrl = ("" + item.title.toLowerCase() + "-logo.png");
    template: `
<div class="my-list-item" style="display:flex;">
    <img class="list-item_image" v-bind:src="item.logoUrl" alt="Logo" />
    <span class="list-item_text">{{ item.title }}</span>
            var app = new Vue({
            el: '#surveyElement',
            survey: survey

<!DOCTYPE html>
<html lang="en">
    <title>Dropdown with Custom Item Template, Vue Survey Library Example</title>
<meta name="viewport" content="width=device-width" />
    <script src=""></script>
    <script src="/DevBuilds/survey-core/survey.core.min.js"></script>
    <script src="/DevBuilds/survey-core/survey.i18n.min.js"></script>
    <script src="/DevBuilds/survey-vue-ui/survey-vue-ui.min.js"></script>
    <link href="/DevBuilds/survey-core/defaultV2.min.css" type="text/css" rel="stylesheet" />
    <link rel="stylesheet" href="./index.css">

<body style="margin: 0">
            <div id="surveyElement" style="display:inline-block;width:100%;">
                <survey :survey='survey' />
    <div id="surveyResult"></div>

<script type="text/javascript" src="./index.js"></script>


.list-item_text {
    padding: 10px;

.list-item_image {
    width: 60px;
    height: 45px;
    vertical-align: middle;

If you want to customize a drop-down menu item, follow the steps below:

  1. Implement a component that renders item markup.
    The item is an IAction object. You can use component props to access it.

  2. Register the component so that it can be accessed by name.
    In React, register the component in ReactElementFactory as shown in the JavaScript tab.

    In Vue and Knockout, use techniques native to these libraries:

  3. Assign the component name to the Dropdown question's itemComponent property in the survey JSON definition.