{"id":19994491,"url":"https://github.com/eyelly-wu/react-printer","last_synced_at":"2026-05-08T06:07:13.174Z","repository":{"id":39393636,"uuid":"200354543","full_name":"eyelly-wu/react-printer","owner":"eyelly-wu","description":" A simple react component for partial printing on the browser","archived":false,"fork":false,"pushed_at":"2022-11-25T03:36:12.000Z","size":139,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-27T07:34:39.632Z","etag":null,"topics":["print","printer","react","react-print","react-printer"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eyelly-wu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-03T09:00:53.000Z","updated_at":"2023-06-06T12:58:40.000Z","dependencies_parsed_at":"2022-08-30T09:53:04.496Z","dependency_job_id":null,"html_url":"https://github.com/eyelly-wu/react-printer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyelly-wu%2Freact-printer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyelly-wu%2Freact-printer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyelly-wu%2Freact-printer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eyelly-wu%2Freact-printer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eyelly-wu","download_url":"https://codeload.github.com/eyelly-wu/react-printer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241435151,"owners_count":19962401,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["print","printer","react","react-print","react-printer"],"created_at":"2024-11-13T04:55:21.961Z","updated_at":"2026-05-08T06:07:08.153Z","avatar_url":"https://github.com/eyelly-wu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React-Printer\n\nReact-Printer is a simple react component for partial printing on the browser\n\n## Installation\n\n**NPM**\n```\nnpm i -S @eyelly/react-printer\n```\n**CDN**\n```HTML\n\u003cscript src=\"https://unpkg.com/@eyelly/react-printer/dist\"\u003e\u003c/script\u003e\n```\n## Usage \u0026 Example\n\n**In Module**\n```javascript\nimport React, { useRef } from 'react'\nimport Printer from '@eyelly/react-printer'\n\nfunction App() {\n  const printContent = useRef(null)\n\n  return (\n    \u003c\u003e\n      \u003cdiv ref={printContent}\u003e this is content to print \u003c/div\u003e\n      \u003cdiv\u003e this is normal content \u003c/div\u003e\n      \u003cPrinter content={printContent}\u003e\n        \u003cbutton\u003ePrinter\u003c/button\u003e\n      \u003c/Printer\u003e\n    \u003c/\u003e\n  )\n}\n```\n**In HTML**\n```\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\n  \u003chead\u003e\n    \u003cscript src=\"https://unpkg.com/react/umd/react.development.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"https://unpkg.com/react-dom/umd/react-dom.development.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"https://unpkg.com/babel-standalone/babel.min.js\"\u003e\u003c/script\u003e\n    \u003cscript src=\"https://unpkg.com/@eyelly/react-printer/dist\"\u003e\u003c/script\u003e\n  \u003c/head\u003e\n\n  \u003cbody\u003e\n    \u003cdiv id=\"app\"\u003e\u003c/div\u003e\n    \u003cscript type=\"text/babel\"\u003e\n\n      function App(){\n        const printContent = React.useRef(null)\n        return (\n          \u003cReact.Fragment\u003e\n            \u003cdiv ref={printContent}\u003e this is content to print \u003c/div\u003e\n            \u003cdiv\u003e this is normal content \u003c/div\u003e\n            \u003cPrinter content={printContent}\u003e\n              \u003cbutton\u003eprinter\u003c/button\u003e\n            \u003c/Printer\u003e\n          \u003c/React.Fragment\u003e\n        )\n      }\n\n      ReactDOM.render( \u003cApp/\u003e , document.getElementById('app') )\n    \u003c/script\u003e\n  \u003c/body\u003e\n\n\u003c/html\u003e\n\n```\n## API\n\n| Property  | Description                          | Type                  | Default |\n| :-------- | :----------------------------------- | :-------------------- | :------ |\n| content   | content to be printed                | {current:HTMLElement} | -       |\n| shotcut   | enable browser printing shortcut     | boolean               | true    |\n| newWindow | open a new window to print           | boolean               | false   |\n| title     | the title of the newly opened window | boolean               | -       |\n\n## License\n\n[MIT](https://github.com/eyelly-wu/react-printer/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyelly-wu%2Freact-printer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feyelly-wu%2Freact-printer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feyelly-wu%2Freact-printer/lists"}