JSPM

ngx-text-overflow-clamp-v2

2.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q46240F
  • License ISC

An Angular 20+ wrapper for text-overflow-clamp

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ngx-text-overflow-clamp-v2) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    ngx-text-overflow-clamp-v2: Angular 20+ wrapper for text-overflow-clamp

    npm version

    🔄 This is a modernized fork of mbenzenhoefer/ngx-text-overflow-clamp updated for Angular 20+ compatibility.

    Maintained by @raazatul7GitHub Repo

    This library wraps the plain JS library text-overflow-clamp for Angular 20+ usage, providing a simple directive to clamp overflowing text to a specified number of lines.

    Installation

    npm install --save ngx-text-overflow-clamp-v2 text-overflow-clamp

    Usage

    import { TextOverflowClampDirective } from 'ngx-text-overflow-clamp-v2';
    
    @Component({
      selector: 'my-component',
      standalone: true,
      imports: [TextOverflowClampDirective],
      template: `
        <div style="width:250px;">
          <div [clamp]="2">
            Lorem ipsum dolor sit amet, ...
          </div>
        </div>
      `
    })
    export class MyComponent {}

    NgModule (Legacy/Compatible)

    import { NgxTextOverflowClampModule } from 'ngx-text-overflow-clamp-v2';
    
    @NgModule({
      imports: [NgxTextOverflowClampModule]
    })
    export class MyModule {}

    Example

    <!-- the outer container MUST have a width! -->
    <div style="width:250px;">
      <!-- we want two lines max. -->
      <div [clamp]="2">
        Lorem ipsum dolor sit amet, consetetur sadipscing elitr, ...
      </div>
    </div>

    Will become (depending on font size etc.):

    Lorem ipsum dolor sit amet, consetetur
    sadipscing elitr, sed diam nonumy...

    About

    Why This Fork?

    The original ngx-text-overflow-clamp library needed updates for Angular 20+ compatibility. This fork provides:

    • Updated dependencies for Angular 20+
    • Modern standalone component support
    • Continued maintenance and updates