# react-print-tool

> Provides methods to open print preview for a specific component

Latest version **3.0.0** (published 2019-08-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-print-tool
pnpm add react-print-tool
yarn add react-print-tool
bun add react-print-tool
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2019-08-15 |
| First published | 2018-06-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Mohamed Amine BCHIR |
| Maintainers | amine_bchir |
| Keywords | PrintPreview, Print-Preview, Print-Component, Print, Preview, React, Typescript, react-print-tool, reactjs, print-element |

## Links

- npm: https://www.npmjs.com/package/react-print-tool
- Repository: https://github.com/Bchir/react-print-tool
- Homepage: https://github.com/Bchir/react-print-tool#readme
- Issues: https://github.com/Bchir/react-print-tool/issues
- npm.io page: https://npm.io/package/react-print-tool

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2019-08-15
- 2.0.0 — 2018-12-15
- 1.0.5 — 2018-07-25
- 1.0.4 — 2018-06-03
- 0.0.1 — 2018-06-03

## README

# react-print-tool

Provides methods to open print preview for a specific component

## Installation

if you're using react version >= 16.8.0

```
npm install react-print-tool@latest
```

else

```
npm install react-print-tool@2.0.0
```

## Usage

### Version 3.0.0


```Typescript

import {
  printComponent,
  printExistingElement,
  printHtml
} from "react-print-tool";

//use your own react component
await printComponent(<TheBestReactComponent prop={data} />);

// use html in a string
await printHtml("<div>Hello world</div>");

// use selector to print an existing html element
await printExistingElement("div.elementClass #elementID");

```

### Version 2.0.0

Import the react tool object and use one of the provided methods

## Example

```Typescript

 import { PrintTool } from "react-print-tool"

//use your own react component
 PrintTool.printFromReactComponent(<TheBestReactComponent prop={data} /> )

 // use html in a string
 PrintTool.printFromString("<div>Hello world</div>" )

// use selector to print an existing html element
 PrintTool.printExistingElement("div.elementClass #elementID")

```

---
_Source: https://npm.io/package/react-print-tool · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
