Creating HTML Elements

Build user interfaces using HTML markup or JavaScript DOM methods

UXP lets you create UI elements in two ways: define them in HTML or create them dynamically with JavaScript. Both approaches work for Panel plugins, while Command plugins can only create modal dialogs using JavaScript.

Prerequisites

Before you begin, make sure your development environment uses the following versions:

  • Premiere v25.6 or higher
  • UDT v2.2 or higher
  • Manifest version v5 or higher

Example: Using HTML Markup

Define your UI structure in HTML, then control it with JavaScript.

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

Sample dialog created with HTML markup

Example: Using JavaScript Only

Create and style elements dynamically using JavaScript DOM methods.

Copied to your clipboard
<!DOCTYPE html>
<html>
<head>
<script src="main.js"></script>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<button id="showDialog">Show Dialog</button>
</body>
</html>

Sample dialog created with JavaScript

Creating Spectrum Components

You can use document.createElement() to create Spectrum UI elements dynamically:

Copied to your clipboard
// Create a Spectrum button
const button = document.createElement("sp-button");
button.textContent = "Click me";
button.setAttribute("variant", "cta");
document.body.appendChild(button);

Reference Material

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