{"id":22559650,"url":"https://github.com/am-77/react-coder","last_synced_at":"2025-04-10T09:27:17.404Z","repository":{"id":42829923,"uuid":"265888946","full_name":"AM-77/react-coder","owner":"AM-77","description":"A lightweight syntax highlighter, code wrapper and editor for react","archived":false,"fork":false,"pushed_at":"2023-01-06T06:35:41.000Z","size":2047,"stargazers_count":6,"open_issues_count":20,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T13:05:15.239Z","etag":null,"topics":["codewrapper","component","editor","react","syntax-highlighting"],"latest_commit_sha":null,"homepage":"https://am-77.github.io/react-coder/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AM-77.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-05-21T15:48:51.000Z","updated_at":"2023-08-21T14:15:06.000Z","dependencies_parsed_at":"2023-02-05T13:16:59.910Z","dependency_job_id":null,"html_url":"https://github.com/AM-77/react-coder","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AM-77%2Freact-coder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AM-77%2Freact-coder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AM-77%2Freact-coder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AM-77%2Freact-coder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AM-77","download_url":"https://codeload.github.com/AM-77/react-coder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248190941,"owners_count":21062381,"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":["codewrapper","component","editor","react","syntax-highlighting"],"created_at":"2024-12-07T21:07:48.795Z","updated_at":"2025-04-10T09:27:17.376Z","avatar_url":"https://github.com/AM-77.png","language":"TypeScript","readme":"\u003cimg src=\"https://i.imgur.com/ztTYPJI.png\" height=\"200px\"/\u003e\n\n# react-coder\n\n\u003e a lightweight react code wrapper and editor component\n\n[![NPM](https://img.shields.io/npm/v/react-coder.svg)](https://www.npmjs.com/package/react-coder) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/react-coder)\n\n## Install\n\n```bash\nnpm install --save react-coder\n```\n\n**or**\n\n```bash\nyarn add react-coder\n```\n\n## Usage\n\nImport the Editor from 'react-coder' and using it.\n\n```jsx\nimport Editor from 'react-coder';\n\n\u003cdiv height='500px' width='80%'\u003e\n  \u003cEditor \n    fontSize={12} \n    onCodeChange={onCodeChange} \n    language={\"jsx\"} \n    readOnly={true} \n    lineNumbers={true} \n    code={usage_code} \n    copy={true} /\u003e\n\u003c/div\u003e\n```\n\n\n\n#### NOTE:\n\n\u003e   The height \u0026 width of the Editor equals the height \u0026 width of the div wrapping it\n\n## Available Props:\n\n### fontSize\n\nThe size of the font, default: 13px\n\n**Options:** `css font-size`\n\n\n\n### onCodeChange\n\nA code change handler.\n\n**Options:** `onCodeChange(code: string)`\n\n\n\n### language\n\nHightlight the code based on the selected langauge, default: 'js'\n\n**Options:** `check the supported languages here [supported-languages](https://prismjs.com/index.html#supported-languages)`\n\n\n\n### readOnly\n\nEdit permission. default: false\n\n**Options:** `true` or `false`\n\n\n\n### lineNumbers\n\nDisplay or hide the line numbers. default: false\n\n**Options:** `true` or `false`\n\n\n\n### copy\n\nDisplay or hide the copy to clipboard button. default: false\n\n**Options:** `true` or `false`\n\n\n\n### code\n\nThe code you want to display, or edit.\n\n**Options:** `some code`\n\n\n\n## Available themes\n\nYou can find the themes on the [prism repo](https://github.com/PrismJS/prism/tree/master/themes) or in [prism-themes](https://github.com/PrismJS/prism-themes)\n\n## Contribution\n\nFeel free to raise an [Issue](https://github.com/AM-77/react-coder/issues) or submit a [PR](https://github.com/AM-77/react-coder/pulls).\n\n## License\n\nMIT © [AM-77](https://github.com/AM-77/react-coder/blob/master/LICENSE)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fam-77%2Freact-coder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fam-77%2Freact-coder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fam-77%2Freact-coder/lists"}