{"id":19267781,"url":"https://github.com/jhta/simple-draftjs","last_synced_at":"2026-07-02T17:06:41.863Z","repository":{"id":74812812,"uuid":"58104945","full_name":"jhta/simple-draftjs","owner":"jhta","description":"Minimal wysiwyg rich editor using draftjs (Rich editor framework for React).","archived":false,"fork":false,"pushed_at":"2016-05-06T00:30:43.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-05T12:27:48.712Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/jhta.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-05T04:46:56.000Z","updated_at":"2016-05-05T04:47:50.000Z","dependencies_parsed_at":"2023-07-12T09:15:44.451Z","dependency_job_id":null,"html_url":"https://github.com/jhta/simple-draftjs","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/jhta%2Fsimple-draftjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhta%2Fsimple-draftjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhta%2Fsimple-draftjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhta%2Fsimple-draftjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhta","download_url":"https://codeload.github.com/jhta/simple-draftjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240371735,"owners_count":19790888,"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-11-09T20:14:02.657Z","updated_at":"2026-06-30T15:30:16.362Z","avatar_url":"https://github.com/jhta.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Simple Draft-js\n=====================\n\nMinimal wysiwyg rich editor using draftjs (Rich editor framework for React).\n\n### Install\n```\nnpm i -S simple-draftjs\n```\n\n### How to use?\n```javascript\nimport React from 'react';\nimport { render } from 'react-dom';\nimport Editor from 'simple-draftjs';\n\nconst controls = [\n'bold',\n'italic',\n'underline',\n'separator',\n'unordered-list',\n'separator',\n'image',\n'link',\n'unlink',\n'separator',\n'code'\n];\n\nrender(\n  \u003cEditor\n    getContentAction={printHTML}\n    hideButtonAction={closeEditor}\n    placeholder={\"do somenthing!\"}\n    controls={controls}\n  /\u003e,\n  document.getElementById('root')\n);\n\nfunction printHTML(content) {\n  console.log(\"func ok\");\n}\n\nfunction closeEditor() {\n  console.log(\"close\");\n}\n```\n### Options\nOptions should be set via props\n\n##### getContentActions (required)\n[function] callback that return html or markdown content when \"send\" button is clicked or the state change\n```javascript\nfunction getContent(content) {\n    console.log(\"html content\", content); // \u003cp\u003esomething\u003c/p\u003e\n}\n\u003cEditor getContentAction={getContent} /\u003e\n```\n\n##### placeholder (optional)\n[string] placeholder.\n\n##### controls (optional)\n[array] list of elements to show as button options\nNote: separator is the line for serparate items \"|\"\n```javascript\nconst controls = [\n'bold',\n'italic',\n'underline',\n'separator',\n'unordered-list',\n];\n\u003cEditor controls={controls} /\u003e\n```\n##### export (optional)\n[option: \"html\", \"markdown\"]\ndefault: \"html\"\n\n### How to Run?\n\n```\nnpm install\nnpm start\nopen http://localhost:3002\n```\n#### Contribute: https://github.com/jhta/simple-draftjs\n\n### Dependencies\n\n* [React](https://facebook.github.io/react/)\n* [Webpack](https://webpack.github.io/)\n* [draft-js](https://facebook.github.io/draft-js)\n* [webpack-dev-server](https://github.com/webpack/webpack-dev-server)\n* [babel-loader](https://github.com/babel/babel-loader)\n* [react-hot-loader](https://github.com/gaearon/react-hot-loader)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhta%2Fsimple-draftjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhta%2Fsimple-draftjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhta%2Fsimple-draftjs/lists"}