← All pipes
Text

wrapWords

Plain-text messages wrap to grapheme-bounded lines.

Use it in your component

Standalone component
import { Component } from '@angular/core';
import { WrapWordsPipe } from 'extra-pipe';

@Component({
  standalone: true,
  imports: [WrapWordsPipe],
  template: `{{ "one two three" | wrapWords: 7 }}`,
})
export class ExampleComponent {

}

Template
{{ "one two three" | wrapWords: 7 }}

Try it live.

The output below runs the packed library. Edit data, not code.

Use double quotes for text, or a number, array, object or null.
Ordered parameters: maximumColumns. Locale is controlled separately.
This pipe has no locale override.
Live template data
readonly value = "one two three";
readonly parameter0 = 7;
{{ value | wrapWords: parameter0 }}

Rendered output

one two
three