xd-dialog-helper

xd-dialog-helper

  • Docs
  • WYSIWYG-Editor
  • GitHub

›Examples

Getting started

  • Installation
  • The first dialog
  • WYSIWYG-Editor
  • Dialog validation
  • Options for showDialog()
  • Custom types

Examples

  • Hello World Dialog
  • Replace text dialog
  • Lorem Ipsum dialog

Reference

  • showDialog()
  • ActionList
  • ContentElementDeclaration
  • ContentElement
  • ContentElementType
  • Types

    • Checkbox
    • Header
    • Horizontal Rule
    • Select / Dropdown
    • Slider
    • Text
    • Text area
    • Text input

Hello World Dialog

Screenshot

screenshot of the "Hello world" dialog

Description

A very bare-bones, "Hello World"-like dialog asking the user for his/her name, as seen in the first dialog section.

Code

const DialogHelper = require('xd-dialog-helper');

async function dialog() {
    try {
        const results = await DialogHelper.showDialog(
            'my-dialog', 
            'Hello world',
            [
                {
                    id: 'name',
                    type: DialogHelper.types.TEXT_INPUT,
                    label: 'What\'s your name?'
                },
            ]
        );
        console.log('Hello, ' + results['name']);
    } catch (e) {
        console.log('The user has cancelled the dialog.');
    }
}
← Custom typesReplace text dialog →
  • Screenshot
  • Description
  • Code
xd-dialog-helper
Docs
Getting StartedExamplesAPI Reference
Community
User ShowcaseTwitter
More
GitHubLegal NoticePrivacy Policy
Copyright © 2019 Pablo Klaschka