npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@reiagaru/ngx-rwriter

v1.1.3

Published

A powerful, lightweight, and modern Rich Text Editor component for Angular 21+ with native support for images, alignment, lists, color pickers, and translations.

Downloads

1,556

Readme

ngx-rwriter

ngx-rwriter is a powerful, lightweight, and modern Rich Text Editor for Angular 21+. It provides a familiar, Word-like interface with native support for images, videos, alignment, and formatting.

Features

  • Formatting: Bold, Italic, Underline, Paragraph Styles (P, H1-H4), Font Family selection, and Text/Background Color pickers.
  • Lists: Bulleted (<ul>) and Numbered (<ol>) lists.
  • Alignment: Left, Center, Right, and Justified alignment for text, images, and videos.
  • Video Support:
    • YouTube: Paste standard or shortened YouTube URLs.
    • Direct Links: Support for .mp4, .webm, and .ogg files.
    • Visual Resizing: Click a video to reveal handles and resize it directly.
  • Image Support:
    • Drag-and-drop or select images.
    • Visual Resizing: Click an image to reveal handles and resize it directly.
    • Flexible Uploads: Choose between automatic Base64 encoding or custom server-side uploads.
  • Links: Modern custom palette for inserting hyperlinks.
  • Form Support: Fully compatible with ngModel and Reactive Forms (formControl, formControlName).
  • Clean Output: Generates clean, semantic HTML.

Installation

npm i @reiagaru/ngx-rwriter

Basic Usage

1. Import the Component

Since ngx-rwriter is a standalone component, you can import it directly into your component or module.

import { NgxRwriter } from '@reiagaru/ngx-rwriter';
import { FormsModule } from '@angular/forms';

@Component({
  standalone: true,
  imports: [NgxRwriter, FormsModule],
  template: `
    <ngx-rwriter [(ngModel)]="htmlContent"></ngx-rwriter>
  `
})
export class MyComponent {
  htmlContent = '<p>Hello World!</p>';
}

Rendering Output (Fixing Broken Styles)

Rich text editors generate raw HTML tags (like <p>, <ul>, <h1>) that often lose their default styling when placed in an Angular app—especially if you use a framework like Tailwind CSS that aggressively resets defaults (Preflight).

Furthermore, Angular's default HTML sanitization strips out inline CSS styles (like text highlighting and background colors) used by the editor.

To solve both of these issues, ngx-rwriter provides a dedicated standalone Viewer component. It automatically isolates the HTML from global CSS resets and securely renders the inline styles.

Using the Viewer Component

Import the <ngx-rwriter-viewer> standalone component and pass your backend HTML string to the [content] input.

import { NgxRwriterViewer } from '@reiagaru/ngx-rwriter';

@Component({
  standalone: true,
  imports: [NgxRwriterViewer],
  template: `
    <ngx-rwriter-viewer 
      [content]="savedNewsHtml" 
      theme="auto">
    </ngx-rwriter-viewer>
  `
})
export class NewsArticleComponent {
  // This string from your backend will render safely with all colors and margins intact
  savedNewsHtml = '<h1 style="background-color: yellow;">My Article</h1><p>...</p>';
}

Documentation

Inputs

| Property | Type | Default | Description | | :--- | :--- | :--- | :--- | | imageConfig | ImageUploadConfig | { mode: 'base64' } | Configuration for how images are handled when inserted. | | translations| RwriterTranslations| RW_EN | Dictionary for overriding tooltip/placeholder text. | | theme | 'auto' \| 'light' \| 'dark' | 'auto' | Switches the editor interface theme. Auto uses OS preference. | | height | string | undefined | Optional fixed height for the editor area (e.g. '500px'). |

Internationalization (i18n)

ngx-rwriter provides a scalable translation input. It ships with built-in dictionaries for English, Russian, and Kazakh.

import { NgxRwriter, RW_RU, RW_EN, RW_KK } from '@reiagaru/ngx-rwriter';

@Component({
  standalone: true,
  imports: [NgxRwriter],
  template: `
    <ngx-rwriter [translations]="currentLang"></ngx-rwriter>
  `
})
export class MyComponent {
  // Use built-in Russian dictionary
  currentLang = RW_RU; 
}

Advanced Media Features

Resizing

Simply click on any image or video inside the editor. A blue dashed box with handles will appear. Drag the handles to resize the element.

Alignment

While a media element is selected, using the alignment buttons (Left, Center, Right) will apply specific styles:

  • Left/Right: Floats the element and allows text to wrap around it.
  • Center: Displays the element as a block centered on the page.

CSS Overrides

| Class | Description | | :--- | :--- | | .rwriter-container | The outermost wrapper of the entire component. | | .dark-theme | Applied to the container when theme is dark. | | .rwriter-toolbar | The toolbar container holding all buttons. | | .input-palette | The custom dropdown for Link and Video URLs. | | .rwriter-editor | The actual contenteditable area. | | .image-resizer-overlay | The resize handles overlay. |

License

MIT