Skip to content

Other Frameworks

Terminal window
npm install @updog/data-editor-wc

Register the custom element once, typically in your app’s entry point:

import "@updog/data-editor-wc";
import "@updog/data-editor-wc/styles.css";

This defines <updog-editor> globally. Both imports are required — without the stylesheet the editor renders unstyled.

Registering the element is not enough on its own. Vue and Angular need to be told that updog- tags are custom elements rather than components they should resolve.

vite.config.ts
vue({
template: {
compilerOptions: {
isCustomElement: (tag) => tag.startsWith("updog-"),
},
},
})

Without this, Vue logs Failed to resolve component: updog-editor and renders nothing.

<updog-editor> is one element for every framework, so it deliberately has one way to be configured. Simple values can be written as HTML attributes; everything else goes through configure().

How to set itWorks in
api-key, primary-key, variant, mode, localeHTML attributeevery framework
open, rtl, readonlyHTML attribute (presence means true)every framework
columns, loadData, translations, remoteSources, synonyms, …configure()every framework
onComplete, onError, onColumnMatch, onValueMatchconfigure()every framework
closing the modalclose eventevery framework
<button id="open-btn">Open Editor</button>
<updog-editor id="editor"></updog-editor>
<script type="module">
import "@updog/data-editor-wc";
import "@updog/data-editor-wc/styles.css";
const editor = document.getElementById("editor");
editor.configure({
apiKey: "your-license-key",
columns: [
{ id: "name", title: "Full Name", size: 200, validators: [{ type: "required", message: "Name is required" }] },
{ id: "email", title: "Email", size: 250, validators: [{ type: "required", message: "Email is required" }, { type: "email", message: "Invalid email" }] },
{ id: "role", title: "Role", editor: { type: "select", options: ["Admin", "Editor", "Viewer"] } },
],
primaryKey: "id",
loadData: async (onChunk) => {
const res = await fetch("/api/employees");
const rows = await res.json();
onChunk(rows);
},
onComplete: async (result) => {
console.log("Sources:", result.sources);
console.log("Counts:", result.counts);
},
});
document.getElementById("open-btn").addEventListener("click", () => editor.show());
editor.addEventListener("close", () => console.log("Editor closed"));
</script>

configure() accepts the same props as the React component, minus open and onClose — use show() / hide() and the close event instead.