{"id":13473202,"url":"https://github.com/jodit/jodit-react","last_synced_at":"2025-05-14T11:08:43.739Z","repository":{"id":27351599,"uuid":"113567886","full_name":"jodit/jodit-react","owner":"jodit","description":"React wrapper for Jodit","archived":false,"fork":false,"pushed_at":"2025-04-01T20:30:41.000Z","size":3003,"stargazers_count":386,"open_issues_count":193,"forks_count":129,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-27T08:02:56.617Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/jodit.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-12-08T11:34:14.000Z","updated_at":"2025-04-23T03:08:23.000Z","dependencies_parsed_at":"2022-07-13T01:40:32.597Z","dependency_job_id":"a55e6700-6c98-4875-95fb-bc2eba6ff244","html_url":"https://github.com/jodit/jodit-react","commit_stats":{"total_commits":342,"total_committers":19,"mean_commits":18.0,"dds":0.5058479532163742,"last_synced_commit":"96d705e95f93c31f22887c25bf1438e87f86158a"},"previous_names":[],"tags_count":317,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jodit%2Fjodit-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jodit%2Fjodit-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jodit%2Fjodit-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jodit%2Fjodit-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jodit","download_url":"https://codeload.github.com/jodit/jodit-react/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251305408,"owners_count":21568059,"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":[],"created_at":"2024-07-31T16:01:01.659Z","updated_at":"2025-05-14T11:08:43.715Z","avatar_url":"https://github.com/jodit.png","language":"TypeScript","readme":"# React Jodit WYSIWYG Editor\n\n[![npm](https://img.shields.io/npm/v/jodit-react.svg)](https://www.npmjs.com/package/jodit-react)\n[![npm](https://img.shields.io/npm/dm/jodit-react.svg)](https://www.npmjs.com/package/jodit-react)\n[![npm](https://img.shields.io/npm/l/jodit-react.svg)](https://www.npmjs.com/package/jodit-react)\n\nReact wrapper for [Jodit](https://xdsoft.net/jodit/)\n\n\u003e [Jodit React PRO](https://xdsoft.net/jodit/pro/) it is an extended version of Jodit React with the same API, but with a lot more features.\n\n## Installation\n\n```bash\nnpm install jodit-react --save\n```\n\n## Update editor version\n\n```bash\nnpm update jodit-react\n```\n\n## Run demo\n\n```bash\nnpm install --dev\nnpm run demo\n```\n\nand open\n\n```\nhttp://localhost:4000/\n```\n\n## Usage\n\n### 1. Require and use Jodit-react component inside your application.\n\n```jsx\nimport React, { useState, useRef, useMemo } from 'react';\nimport JoditEditor from 'jodit-react';\n\nconst Example = ({ placeholder }) =\u003e {\n\tconst editor = useRef(null);\n\tconst [content, setContent] = useState('');\n\n\tconst config = useMemo(() =\u003e ({\n\t\t\treadonly: false, // all options from https://xdsoft.net/jodit/docs/,\n\t\t\tplaceholder: placeholder || 'Start typings...'\n\t\t}),\n\t\t[placeholder]\n\t);\n\n\treturn (\n\t\t\u003cJoditEditor\n\t\t\tref={editor}\n\t\t\tvalue={content}\n\t\t\tconfig={config}\n\t\t\ttabIndex={1} // tabIndex of textarea\n\t\t\tonBlur={newContent =\u003e setContent(newContent)} // preferred to use only this option to update the content for performance reasons\n\t\t\tonChange={newContent =\u003e {}}\n\t\t/\u003e\n\t);\n};\n```\n\n### Jodit plugins\n\nYou can use all Jodit features and write your [own plugin](https://xdsoft.net/jodit/docs/modules/plugin.html) for example.\n\n```js\nimport JoditEditor, { Jodit } from 'jodit-react';\n\n/**\n * @param {Jodit} jodit\n */\nfunction preparePaste(jodit) {\n\tjodit.e.on(\n\t\t'paste',\n\t\te =\u003e {\n\t\t\tif (confirm('Change pasted content?')) {\n\t\t\t\tjodit.e.stopPropagation('paste');\n\t\t\t\tjodit.s.insertHTML(\n\t\t\t\t\tJodit.modules.Helpers.getDataTransfer(e)\n\t\t\t\t\t\t.getData(Jodit.constants.TEXT_HTML)\n\t\t\t\t\t\t.replace(/a/g, 'b')\n\t\t\t\t);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t\t{ top: true }\n\t);\n}\nJodit.plugins.add('preparePaste', preparePaste);\n\n//...\nreturn \u003cJoditEditor /\u003e;\n```\n\nYou can see how to write plugins [in the documentation](https://xdsoft.net/jodit/pro/docs/how-to/create-plugin.md) or [on the stand](https://xdsoft.net/jodit/pro/docs/getting-started/examples.md#jodit-example-paste-link)\n\n## Use with Jodit PRO\n\nYou can connect any Jodit constructor and set it as the `JoditConstructor` property of the component.\n\n```jsx\nimport React from 'react';\nimport JoditEditor from 'jodit-react';\nimport {Jodit} from 'jodit-pro';\nimport 'jodit-pro/es5/jodit.min.css';\n// ...\n\nfunction App() {\n  return \u003cJoditEditor JoditConstructor={Jodit} /\u003e;\n}\n\n```\n\n\n## License\n\nThis package is available under `MIT` License.\n","funding_links":[],"categories":["Integrations","基于 React","For React"],"sub_categories":["Jodit React"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjodit%2Fjodit-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjodit%2Fjodit-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjodit%2Fjodit-react/lists"}