The Research Report
Microsoft Promptions: Ephemeral UI for Dynamic Prompt Control
Microsoft Research released Promptions in July 2025 as an open‑source TypeScript library under the MIT license. Promptions is a lightweight middleware that turns a natural‑language prompt plus an optional JSON schema into a set of ephemeral UI widgets. Users interact with the widgets, and the underlying prompt is updated in real time. The result is a dynamic prompt surface that lets developers expose controllable parameters without writing custom front‑ends.
Promptions overlaps with the broader Malleable Prompting movement, but it has a distinct focus and design philosophy. This article explains what Promptions does, how it differs from Malleable Prompting, and how developers can get started.
1. The Core Idea: Prompt‑driven UI Generation
At its simplest, Promptions takes two inputs:
- A base prompt – the string that will be sent to a language model.
- A schema – a JSON schema that describes the parameters you’d like to expose (type, range, description, default, etc.).
Promptions then generates a React component (or plain HTML) that renders input controls matching the schema: sliders, dropdowns, checkboxes, or free‑text fields. When a user changes a control, Promptions re‑writes the prompt on the fly and re‑submits it to the model.
import { Prompter } from "@microsoft/promptions";
const schema = {
type: "object",
properties: {
tone: {type: "string", enum: ["formal", "casual"], default: "formal"},
length: {type: "integer", minimum: 50, maximum: 500, default: 200},
includeExamples: {type: "boolean", default: false}
}
};
const prompt = "Write a summary of the following article about quantum computing.";
const UI = new Prompter(prompt, schema);
UI.render(document.getElementById("root"));
The UI appears instantly, and each change produces a new prompt such as:
Write a formal summary (200 words) of the following article about quantum computing. Include examples.
Because the UI is ephemeral, it lives only for the duration of the interaction. No persistent backend is required; the entire rendering and prompt stitching happens in the client.
2. How Promptions Differs from Malleable Prompting
| Feature | Promptions | Malleable Prompting |
|---|---|---|
| Primary Audience | Developers building interactive UI for end‑users (e.g., chat widgets, data‑exploration tools). | Prompt engineers building prompt templates that can be rendered as UI later, often via separate tooling. |
| Implementation Language | TypeScript/JavaScript, tightly integrated with React and modern web stacks. | Language‑agnostic; implementations exist in Python, Rust, Go, and JavaScript. |
| Schema Format | JSON Schema (standard, IDE‑friendly). | Custom schema DSL or OpenAI function schema; more flexible but less standardised. |
| Runtime Model | Client‑side only – the UI and prompt generation run entirely in the browser (or Node). | Can be client‑side or server‑side; often a separate service constructs prompts based on stored state. |
| State Persistence | Ephemeral – no automatic persistence; developers add storage if needed. | Often tied to a persistent prompt store (e.g., a database) as part of a larger prompt‑management system. |
| Extensibility | Built‑in support for sliders, selects, booleans, and free text. Custom widgets require manual React code. | Extensible via any language; you can embed arbitrary code to produce UI. |
| Open‑source License | MIT – permissive, easy for commercial use. | Varies: many implementations are Apache‑2.0 or GPL. |
In short, Promptions is a concrete UI‑generation layer that assumes you already have a web front‑end. Malleable Prompting is a broader methodology for turning prompts into UI, often with a separate storage layer. If you need a quick, turn‑key widget for a web app, Promptions is the simpler choice.
3. Practical Getting Started
3.1 Prerequisites
- Node ≥ 18 (or a modern browser with ES6 modules).
- A language‑model API key (OpenAI, Anthropic, Azure, etc.).
- Basic knowledge of React or vanilla DOM manipulation.
3.2 Installation
npm install @microsoft/promptions
Or, using Yarn:
yarn add @microsoft/promptions
3.3 Minimal Example
Create index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Promptions Demo</title>
<script type="module" src="app.js"></script>
</head>
<body>
<div id="root"></div>
</body>
</html>
Create app.js:
import { Prompter } from "@microsoft/promptions";
import "@microsoft/promptions/dist/promptions.css"; // optional styling
const schema = {
type: "object",
properties: {
temperature: {type: "number", minimum: 0, maximum: 1, default: 0.7},
maxTokens: {type: "integer", minimum: 50, maximum: 1024, default: 256},
style: {type: "string", enum: ["concise", "detailed"], default: "concise"}
}
};
const basePrompt = "Explain the theory of relativity in plain language.";
const prompter = new Prompter(basePrompt, schema, {
onSubmit: async (fullPrompt) => {
// Call your LLM endpoint – replace with your provider
const response = await fetch("https://api.openai.com/v1/chat/completions", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.OPENAI_API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "gpt-4o-mini",
messages: [{role: "user", content: fullPrompt}],
max_tokens: 500
})
}).then(r => r.json());
// Display the model's answer
document.getElementById("output").innerText = response.choices[0].message.content;
}
});
prompter.render(document.getElementById("root"));
Add a simple output container to index.html:
<div id="output" style="margin-top: 1rem; white-space: pre-wrap;"></div>
Now open index.html in a browser. You’ll see sliders for temperature and max‑tokens and a dropdown for style. Adjusting any control updates the prompt and calls the model in real time.
3.4 Deploying a Production Widget
Promptions can be bundled with any front‑end framework (Next.js, Vite, Create‑React‑App). The library is tree‑shakable, so only the widgets you use end up in the final bundle.
For server‑side rendering, you can use the renderToString API to produce the initial widget markup, then hydrate on the client.
4. Use Cases
| Domain | Typical Promption Controls | Outcome |
|---|---|---|
| Customer Support | Tone (formal/casual), urgency level, knowledge‑base filter | Agents respond with the right style while letting users tweak aggressiveness. |
| Content Creation | Length, style, include examples, target audience | Writers get instant previews of blog drafts, adjusting length without re‑typing prompts. |
| Data Analysis | Chart type, aggregation window, filter predicates | Data‑exploration dashboards let analysts steer LLM‑generated insights with sliders. |
| Education | Difficulty, topic depth, hint level | Tutoring bots adapt explanations on the fly, matching learner skill. |
5. Limitations & Open Questions
- Ephemeral nature – Promptions does not store a history of UI configurations. If you need persistent user preferences, you must integrate a backend.
- Schema complexity – JSON Schema can become verbose for nested objects. The library currently supports only top‑level primitive fields; nested objects require custom widget code.
- Model‑agnosticism – The prompt stitching logic is simple string concatenation. For models that require special token‑level control (e.g., function calling), you’ll need to layer additional logic.
Future work (open‑sourced in the repo) includes:
- Schema‑driven validation that highlights invalid combinations before hitting the model.
- Dynamic schema updates – the model can request additional parameters, and the UI can render them on the fly.
- Collaborative widgets – multiple users editing the same prompt in real time.
6. Getting Involved
The repo lives at github.com/microsoft/Promptions. Community contributions are encouraged:
- Issues – report bugs, request new widget types, or propose API changes.
- Pull Requests – add support for nested schemas or integrate with other UI libraries (Vue, Svelte).
- Discussions – share use‑cases, compare Promptions to other Malleable Prompting frameworks.
The project is MIT‑licensed, so commercial teams can adopt it without licensing hurdles. The codebase is tiny (<2 kLOC) and documented with typed TypeScript definitions, making it easy to audit.
7. Bottom Line
Promptions gives developers a plug‑and‑play way to surface prompt parameters as UI controls. It bridges the gap between the raw prompt‑engineering workflow and end‑user interaction without building a custom front‑end from scratch. While it shares goals with the broader Malleable Prompting movement—making prompts more controllable—it is purpose‑built for ephemeral, client‑side widget generation.
If you’re already using Malleable Prompting and need a quick UI to let users steer a model, consider dropping Promptions into your stack. For deeper integrations or persistent prompt stores, you can combine Promptions with a Malleable Prompting backend. Either way, the result is a smoother, more interactive experience that puts the user in control of the prompt surface.