Edit in GitHubLog an issue

HTML Elements

UXP core APIs let you create renditions but depending on whether you are writing scripts or plugins, you can create UI either by using HTML tags or just stick to JavaScript.

Let's take 'dialog' as an example and demonstrate both ways. You can extend the same principle to other HTML Elements

System requirements

Please make sure your local environment uses the following application versions before proceeding.

  • InDesign v18.5 or higher
  • UDT v1.9.0 or higher
  • Manifest version v5 or higher

Using HTML

Copied to your clipboard
<button id="showDialog">Show Dialog</button>
<dialog id="sampleDialog">
<div>
<h1>Well hello!</h1>
<p>A dialog built using HTML tags</p>
</div>
</dialog>

Using only JavaScript

Copied to your clipboard
<button id="showDialog">Show Dialog</button>

Sample dialog

Additional notes

  • Creating dialogs within scripts can sometimes be a little tricky requiring you to handle the showing/hiding with async/promises. Check out the script tutorial on modal dialogs.<!--// TODO add linkI>
  • You can also use document.createElement to createSpectrum Widgets sp-* in UXP. However, it will not work for Spectrum Web Components.

Reference material

  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.