ngx-editor
Version:
The Rich Text Editor for Angular, Built on ProseMirror
122 lines (95 loc) • 3.19 kB
Markdown
<p align="center">
<a href="https://github.com/sibiraj-s/ngx-editor">
<img src="./sketch/ngx-editor.svg" alt="ngxEditor">
</a>
</p>
<p align="center">The Rich Text Editor for Angular, Built on ProseMirror</p>
<p align="center">
<a href="https://github.com/sibiraj-s/ngx-editor/actions">
<img alt="Tests" src="https://github.com/sibiraj-s/ngx-editor/workflows/Tests/badge.svg">
</a>
<a href="https://www.npmjs.com/package/ngx-editor">
<img alt="npm version" src="https://badgen.net/npm/v/ngx-editor">
</a>
<a href="https://www.npmjs.com/package/ngx-editor">
<img alt="npm" src="https://badgen.net/npm/dm/ngx-editor">
</a>
<a href="https://www.npmjs.com/package/ngx-editor">
<img alt="npm" src="https://badgen.net/npm/dt/ngx-editor">
</a>
<br />
<a href="https://github.com/sibiraj-s/ngx-editor/blob/master/LICENSE">
<img alt="licence" src="https://badgen.net/npm/license/ngx-editor">
</a>
</p>
> A simple rich text editor for angular applications built with ProseMirror. It is a drop in and easy-to-use editor
> and can be easily extended using prosemirror plugins to build any additional or missing features
[] | [edit on stackblitz][stackblitz] | [documentation] | [migrating from other editors][migration]
Install via Package managers such as [npm] or [pnpm] or [yarn]
```bash
npm install ngx-editor
pnpm install ngx-editor
yarn add ngx-editor
```
**Note**: By default the editor comes with minimal features. Refer the [demo] and [documentation] for more details and examples.
Component
```ts
import { NgxEditorComponent, NgxEditorMenuComponent, Editor } from 'ngx-editor';
import { FormsModule } from '@angular/forms';
@Component({
selector: 'editor-component',
templateUrl: 'editor.component.html',
styleUrls: ['editor.component.scss'],
standalone: true,
imports: [NgxEditorComponent, NgxEditorMenuComponent, FormsModule],
})
export class NgxEditorComponent implements OnInit, OnDestroy {
html = '';
editor: Editor;
ngOnInit(): void {
this.editor = new Editor();
}
ngOnDestroy(): void {
this.editor.destroy();
}
}
```
Then in HTML
```html
<div class="NgxEditor__Wrapper">
<ngx-editor-menu [editor]="editor"> </ngx-editor-menu>
<ngx-editor
[]="editor"
[]="html"
[]="false"
[]="'Type here...'"
></ngx-editor>
</div>
```
Note: Input can be a HTML string or a jsonDoc
Mostly works on all Evergreen-Browsers like
- Google Chrome
- Microsoft Edge
- Mozilla Firefox
- Safari
- Opera
See https://sibiraj-s.github.io/ngx-editor/#/collab
Icons are from https://fonts.google.com/icons
All contributions are welcome. See [CONTRIBUTING.md](./.github/CONTRIBUTING.md) to get started.
[]: https://www.npmjs.com/
[]: https://pnpm.io/
[]: https://yarnpkg.com/lang/en/
[]: https://sibiraj-s.github.io/ngx-editor
[]: https://ngx-editor.stackblitz.io/
[]: https://stackblitz.com/edit/ngx-editor
[]: https://sibiraj-s.github.io/ngx-editor/#/migration