Lightweight Angular rich text editor (standalone) with a reusable toolbar: fonts, sizes, colors, lists, alignment, links.
npm install @stackch/angular-richtext-editorbash
npm
npm install @stackch/angular-richtext-editor
Yarn (Berry/Classic)
yarn add @stackch/angular-richtext-editor
Optional: pin to a specific version
npm install @stackch/angular-richtext-editor@1.1.0
yarn add @stackch/angular-richtext-editor@1.1.0
`
Usage
Import the standalone component and bind to a FormControl:
`ts
import { Component } from '@angular/core';
import { ReactiveFormsModule, FormControl } from '@angular/forms';
import { StackchRichtextEditor } from '@stackch/angular-richtext-editor';
@Component({
standalone: true,
imports: [ReactiveFormsModule, StackchRichtextEditor],
template:
{{ content.value }}
})
export class DemoComponent {
content = new FormControl('');
}
`
Inputs:
- placeholder: string – placeholder text
- showToolbar: boolean – show toolbar (default: true)
- fonts: string[] – font family list
- fontSizes: number[] – font sizes (px)
- height?: number – fixed height
- minHeight: number – min height (px)
- maxHeight?: number – max height (px)
- disabled: boolean – disabled state
Outputs:
- valueChange: string – emitted HTML on changes
Note: The component implements ControlValueAccessor and works with formControl/ngModel.
i18n
English is the default. Use config.i18n for partial overrides or import predefined bundles.
`ts
import { STACKCH_RTE_I18N_DE, STACKCH_RTE_I18N_FR, STACKCH_RTE_I18N_IT } from '@stackch/angular-richtext-editor';
cfg = {
// i18n: undefined, // English defaults
// i18n: STACKCH_RTE_I18N_DE,
// i18n: STACKCH_RTE_I18N_FR,
// i18n: STACKCH_RTE_I18N_IT,
};
`
Customize a few strings:
`ts
cfg = { i18n: { boldTitle: 'Strong', colorsTitle: 'Palette' } };
``