Skip to content

Ngx Simple Text editor or ST editor is a simple native text editor component for Angular 9+.

License

Notifications You must be signed in to change notification settings

Raiper34/ngx-simple-text-editor

Folders and files

NameName
Last commit message
Last commit date
Apr 1, 2024
Dec 30, 2024
Apr 14, 2025
Aug 10, 2024
Apr 14, 2025
Nov 2, 2022
Jan 18, 2025
Aug 10, 2024
Jan 18, 2025
Nov 2, 2022
Dec 29, 2024
Jun 17, 2022
Dec 30, 2024
Apr 6, 2025
Apr 1, 2024
Jan 18, 2025
Jan 18, 2025
Apr 6, 2025
Apr 14, 2025
Apr 1, 2024
Nov 6, 2022
Aug 10, 2024
Apr 6, 2025
Apr 6, 2025
Jun 17, 2022
Jan 10, 2023
Jun 17, 2022

Repository files navigation

npm version docs npm bundle size NPM CircleCI Coverage Status npm npm npm GitHub Repo stars

ngc simple text editor logo

Ngx Simple Text editor

Ngx Simple Text editor or ST editor is a simple native text editor component for Angular 9+. The key features of this editor are simplicity, cross-browser compatibility, and extensibility.

demo

Content

πŸ”— Compatibility

Angular version Ngx simple text editor version Font awesome version
9 - 13 0.0.0 - 1.x.x 5.0.0-6.x.x
14 2.x.x 5.0.0-6.x.x
15 3.x.x 5.0.0-6.x.x
16 4.x.x 5.0.0-6.x.x
17 - 19 5.x.x 5.0.0-6.x.x

πŸš€ Instalation

npm install ngx-simple-text-editor --save

then add NgxSimpleTextEditorModule into module imports

import {NgxSimpleTextEditorModule} from 'ngx-simple-text-editor';

@NgModule({
// ...
  imports: [
    // ...
    NgxSimpleTextEditorModule,
    // ...
  ],
// ...
})

If you want to use default button icons, you must install Font awesome. npm install @fortawesome/fontawesome-free and declare in styles in angular.json

...
"styles": [
  "src/styles.scss",
  "node_modules/@fortawesome/fontawesome-free/css/all.css"
]
...

πŸ’» Usage

You can use Ngx simple text editor as classic template-driven form input or as reactive form input.

<st-editor [(ngModel)]="content" [config]="config"></st-editor>

The editor has got only one @Input with config object, which is optional. The config object is defined by placeholder and buttons, both are optional and can be omitted.

import { Component } from '@angular/core';
import {EditorConfig, ST_BUTTONS} from 'ngx-simple-text-editor';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent {
  content = '';
  config: EditorConfig = {
    placeholder: 'Type something...',
    buttons: ST_BUTTONS,
  };
}

πŸ“š Documentation and demos

Online documentation and demos

βš–οΈ License

MIT