{"repo":"MatthewHerbst/react-to-print","free":true,"listed":false,"github":"https://github.com/MatthewHerbst/react-to-print","clone":"git clone https://github.com/MatthewHerbst/react-to-print.git","description":"Print React components in the browser","language":"TypeScript","stars":2475,"topics":["reactjs","react","javascript"],"license":"MIT","category":"ui-components","readme_excerpt":"ReactToPrint - Print React components in the browser Print the content of a React component. npm install --save react-to-print Demo Usage It is also possible to lazy set the ref if your content being printed is dynamic. See the LazyContent example for more. This can also be useful for setting the ref in non-React code, such as util functions. API Option Type Description :-------------------: :------- :---------------------------------------------------------------------------------------------------------------------------------- bodyClass string One or more class names to pass to the print window, separated by spaces contentRef React.RefObject The ref pointing to the content to be printed. Alternatively, pass the ref directly to the callback returned by useReactToPrint copyShadowRoots boolean Copy shadow root content into the print window. Warning: Use with care if you print large documents as traversing these can be slow. documentTitle string \\ (() = string) Set the title for printing when saving as a file. This is useful for including dynamic data like timestamps. Ignored when passing a custom print option fonts { family: string, source: string; weight?: string; style?: string; }[] A list of fonts to load into the printing iframe. This is useful if you are using custom fonts ignoreGlobalStyles boolean Ignore all and tags nonce string Set the nonce attribute for allow-listing script and style elements for Content Security Policy (CSP) onAfterPrint () = void Callback functio","default_branch":null,"files":null,"tree":[],"storefront":"/r/MatthewHerbst","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/MatthewHerbst/react-to-print/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}