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

ngx-printable-area

v0.0.3

Published

Angular directive to print specific areas of your application with support for multiple zones and loading screens.

Readme

ngx-printable-area

Angular directive to print specific areas of your application with support for multiple zones and loading screens.

npm version Downloads


✨ Major Features

✅ Print only a specific area of your page
✅ Supports printing multiple zones at once
✅ Shows a customizable loading message before printing
✅ Works with Standalone Components and NgModules
✅ Extremely lightweight and zero dependencies
✅ Compatible with Angular 17+


🚀 Installation

Install the package via npm:

npm install --save ngx-printable-area

or with yarn:

yarn add ngx-printable-area

⚙️ Basic Usage

If you’re using Angular standalone components:

import { PrintableAreaDirective } from 'ngx-printable-area';

@Component({
  standalone: true,
  imports: [PrintableAreaDirective],
  template: `
    <div
      ngxPrintableArea
      #printRef="ngxPrintDirective"
      [printTitle]="'My Report'"
      [printStyles]="['/assets/print.css']"
      [loadingTemplate]="'<p>Loading document...</p>'"
    >
      <h1>Report Title</h1>
      <p>Content to print</p>
    </div>

    <button (click)="printRef.print()">Print this section</button>
  `
})
export class DemoComponent {}

Or import the module in your NgModule:

import { PrintableAreaDirective } from 'ngx-printable-area';

@NgModule({
  declarations: [],
  imports: [PrintableAreaDirective],
})
export class AppModule {}

Print Multiple Zones

<div
  ngxPrintableArea
  printId="header"
  [loadingTemplate]="'<p>Preparing document...</p>'"
>
  <h1>Header Section</h1>
</div>

<div
  ngxPrintableArea
  printId="content"
>
  <p>Main content of the report.</p>
</div>

<div
  ngxPrintableArea
  printId="footer"
>
  <p>Footer information.</p>
</div>

<button (click)="printMultiple()">Print Full Report</button>

And in your component:

import { Component } from '@angular/core';
import { PrintService } from 'ngx-printable-area';

@Component({
  selector: 'app-root',
  standalone: true,
  templateUrl: './app.component.html'
})
export class AppComponent {
  constructor(private printService: PrintService) {}

  printMultiple() {
    this.printService.printAreas(
      ['header', 'content', 'footer'],
      'Full Report',
      ['/assets/print.css'],
      '<p>Generating report…</p>'
    );
  }
}

📦 Directive API

PrintableAreaDirective

| Input | Type | Description | | ----------------- | ---------- | ------------------------------------------------------ | | printTitle | string | Title of the printed document window. | | printStyles | string[] | Array of URLs to stylesheets for the print window. | | loadingTemplate | string | HTML shown while preparing the print window. | | printId | string | Unique ID to identify the print area (for multi-zone). |

Methods

| Method | Description | | -------------------- | --------------------------------------------------------- | | print() | Prints only the content of this specific directive area. |

PrintService

| Method | Description | | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------| | printAreas(ids?: string[], title?: string, styles?: string[], loadingTemplate?: string) | Prints multiple registered areas. Pass specific IDs, or omit for printing all registered zones. |

🎯 Compatibility

Angular 17+

Modern browsers

📦 License

MIT © 2025


☕ Buy Me a Coffee

If you find this library helpful, you can support my work:

Buy Me A Coffee

👉 Buy Me a Coffee

🔑 Keywords

angular, ngx, print, printable area, print directive, angular printing, print html, print section, angular standalone, angular directive, ngx library, angular library, ui directive