views.name String

The name of the view. It is used to identify the view. It should be unique.

Example

<div id="aiprompt"></div>
<script>
$("#aiprompt").kendoAIPrompt({
    views: [
        {
            type: 'prompt',
            promptSuggestions: [
                "Act as [actor] and write [format] about [subject] in [100 words]",
                "Suggest post about [subject] that will be used in [social media].",
            ],
        },
        "output",
        {
            type: 'commands',
            promptCommands: [

                { id: "1", text: "Simplify", icon: "min-width" },
                { id: "2", text: "Extend", icon: "arrows-left-right" },
            ]
        },

        {
            name: "custom",
            type: "custom",
            buttonIcon: "pencil",
            buttonText: "Custom View from Options",
            viewTemplate: () => "<div class='custom-view'>Custom View</div>",
            footerTemplate: () => `<div class="k-actions k-actions-start k-actions-horizontal k-prompt-actions">
                        <button ref-custom-button>Click me</button>
                    </div>`,
            initializeComponents: function() {
                var that = this;

                that.element.find("[ref-custom-button]").kendoButton({
                    click: function(e) {
                        console.log("Custom button clicked", e);
                    }
                });
            }
        }]
})
</script>
In this article