Creating a Property Editor
A guide to creating a property editor in Umbraco.
Overview
This guide covers setting up a Property Editor and registering it as a Data Type in Umbraco.
The steps covered in part one are:
This tutorial uses TypeScript and Lit. Make sure your package is already set up before continuing.
To set up an extension using TypeScript and Lit, see the Creating your first extension article.
Resources
This tutorial will not go in-depth on how TypeScript and Lit work. To learn about TypeScript and Lit, you can find their documentation below:
The End Result
By the end of this tutorial, you will have a Suggestions Data Type, registered in the backoffice, and assigned to a Document Type. This Data Type can create and suggest values.
Setting up a plugin
Follow the Vite Package Setup and use
suggestionsas the project name instead ofclient. Create the project in the root of your Umbraco project, next to theApp_Pluginsfolder.Create a manifest file to define and configure the property editor using either JSON or TypeScript.
Create a manifest file named umbraco-package.json in the public folder of the suggestions project. Vite copies it to App_Plugins/suggestions when building.
Extension authors define the property editor UI manifest, then register it dynamically during runtime using a Backoffice Entry Point extension.
Create a manifest file named manifests.ts in the src folder and add the following code:
Create an entry point file named entrypoint.ts in the src folder to register the manifest:
Umbraco still needs an umbraco-package.json file to load the entry point. Create it in the public folder:
Creating a Web Component
Create the web component for the property editor.
Create a file in the
srcfolder with the namesuggestions-property-editor-ui.element.tsIn this new file, add the following code:
Replace the contents of the
vite.config.tsfile with the following code:
The basic parts of the editor are now in place:
The package manifest, telling Umbraco what to load
The web component for the editor
Run the build. In your terminal, go to the
suggestionsfolder and run:
Reload the backoffice.
Registering the Data Type in Umbraco
Add the newly added property editor "Suggestions" in the Document Type and save it.

The property can now be edited using the new Property Editor.
Check out the content where you will see the property editor that looks like this:

Adding styling and setting up events in the Web Components
Start by creating an input field and some buttons to style and hook up to events.
Update the render method to include some input fields and buttons in the
suggestions-property-editor-ui.element.tsfile:
Add some styling. Update the import from lit to include
cssandUmbTextStyles:
Add the CSS:
Run the build. In your terminal, go to the
suggestionsfolder and run:
Reload the backoffice.
It should now look something like this:

Next, set up the event logic.
Set up Event Logic
Set up Input Field
Start with the input field. When typing something in the input field, the property editor's value should change to the input field's current value.
Dispatch a change event using one of two approaches:
Using
new CustomEvent('change')orUsing
new UmbChangeEvent()which is recommended as you can leverage the core class
Add the import so the event can be used:
Add the event to the property editor:
Look at the suggestions button next.
Setup Suggestions Button
When pressing the suggestion button, the text should update to the suggestion received. Similar to how the value of the property editor changes when writing in the input field.
The value should also change when pressing the suggestion button.
Update the import for Lit:
Add suggestions to the property editor:
Update the suggestion button in the render method to call a
onSuggestionmethod when pressing the button:
Run the build. In your terminal, go to the
suggestionsfolder and run:
Clear your cache and reload the backoffice.
Click on the Give me suggestions button to see the Suggestions Data Type in action.

When saving or publishing, the value of the Data Type is automatically synced to the current content object and sent to the server.
To learn more, visit the Property Editors page.
Going further
The Suggestions Data Type is now set up and running. The next part covers adding configurations to the property editor.
Last updated
Was this helpful?