
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
universal-editor-angular
Advanced tools
Universal Editor is a versatile web component designed to integrate seamlessly with Angular. It provides a rich text editing experience, customizable to fit the needs of various web applications. Supported only for Angular 17.

To install the Universal Editor, run the following command in your project directory:
npm install universal-editor-angular
Import component in you component as standalone. as simply use it inside your html template and you should be able to see the component and try it right away.
import { UniversalEditorAngularComponent } from 'universal-editor-angular';
@Component({
selector: 'app-root',
standalone: true,
imports: [ UniversalEditorAngularComponent],
...
})
<universal-editor-angular/>
The library is made for easy and fast integration into project. The complete configuration and available events:
<universal-editor-angular
[config]="config"
[mentionUsers]="users"
(onChangeMentionUsers)="onChangeMentionUsers($event)"
(onFilesChanged)="onFilesChanged($event)"
(onEditorReady)="onEditorReady($event)"
(onChange)="onChange($event)"
/>
The EditorConfig class allows you to customize the Universal Editor to fit your specific requirements. It provides a wide range of options that you can set to enable or disable features within the editor, adjust the UI, and control the behavior of the editor. By default all features are enabled.
To configure the Universal Editor, create an instance of EditorConfig with your desired settings:
import { EditorConfig } from 'universal-editor-angular';
const config = new EditorConfig({
placeholderText: 'Start typing...',
enableItalic: false, // Disables italic formatting adn remove it from toolbar
darkMode: true, // Enables dark mode
// Add other configurations as needed
});
The Universal Editor Library supports mentioning users within the text editor. This feature is configurable through the enableMention option in EditorConfig. To use mentions, you need to provide a list of users that can be mentioned. Users should be defined according to the MentionUser interface with following properties:
To enable mentions, you must supply an array of users conforming to the MentionUser interface. This can be done programmatically by fetching users from a server or by defining a static list. Here is an example of how to define a list of mentionable users:
import { MentionUser } from 'universal-editor-angular';
const users: MentionUser[] = [
{ id: '1', firstName: 'Jane', lastName: 'Doe', email: 'jane.doe@example.com', imageUrl: 'https://example.com/path/to/jane.jpg' },
{ id: '2', firstName: 'John', lastName: 'Doe', email: 'john.doe@example.com' },
// Add more users as needed
];
The onChangeMentionUsers event is specifically designed to capture changes in the array of mentioned users within the editor. It triggers every time there's a change in the mentioned users, such as adding or removing a mention.
onChangeMentionUsers(mentionedUsers: MentionUser[]) {
console.log('Mentioned users changed:', mentionedUsers);
// Process the changes in mentioned users
}
The Universal Editor provides real-time feedback through the onChange event, which fires every time the inner content of the editor changes. This event is crucial for applications that need to capture user input as it happens, for features like auto-saving, validation, or dynamic UI updates based on the content.
onChange(innerHtml: string) {
console.log('Editor content updated:', innerHtml);
// Implement any processing logic here, such as updating a model or making an API call
}
The onEditorReady event is emitted once the Universal Editor is fully initialized and ready for interaction. This event provides an EditorApi object that allows you to programmatically control various aspects of the editor from outside the editor itself. The EditorApi object provided by the onEditorReady event includes the following methods for controlling the editor:
export class MyComponent {
private editorApi: EditorApi;
onEditorReady(api: EditorApi) {
this.editorApi = api;
// Now you can use this.editorApi to control the editor
}
// Example usage of the API
triggerBoldText() {
this.editorApi?.triggerBold();
}
}
The onFilesChanged event is emitted whenever a file is uploaded through the editor, providing you with an array of objects containing the File and a unique key for each uploaded file.
onFilesChanged(files: {file: File; key: string}[]) {
console.log('Files uploaded:', files);
// Process or store the uploaded files as needed
}
When an image is uploaded, it's initially represented as a base64-encoded string within the editor. For optimal performance and to adhere to best practices, it's recommended to store the image on a server or cloud storage and then reference it by URL.
onFilesChanged(files: {file: File; key: string}[]) {
console.log('Files uploaded:', files);
files.forEach(fileObj => {
// Store the file and obtain a URL
this.uploadFile(fileObj.file).then(url => {
// Use the editor API to replace the base64 string with the real URL
this.editorApi.setImageUrl(fileObj.key, url);
});
});
}
FAQs
This is the universal editor library for Angular
We found that universal-editor-angular demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.