{"id":17782309,"url":"https://github.com/niwaa/react-editables","last_synced_at":"2025-03-16T01:33:03.121Z","repository":{"id":143905159,"uuid":"108606455","full_name":"niwaa/react-editables","owner":"niwaa","description":"React-editables is a react component that makes it easy to edit different types of content (Text, Numbers for now)","archived":false,"fork":false,"pushed_at":"2017-10-30T21:20:02.000Z","size":69,"stargazers_count":6,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-27T04:46:32.904Z","etag":null,"topics":["content-editable","editable","editor","react"],"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/niwaa.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":"2017-10-28T00:00:42.000Z","updated_at":"2021-03-17T09:21:54.000Z","dependencies_parsed_at":"2023-06-10T02:00:51.012Z","dependency_job_id":null,"html_url":"https://github.com/niwaa/react-editables","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/niwaa%2Freact-editables","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niwaa%2Freact-editables/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niwaa%2Freact-editables/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niwaa%2Freact-editables/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niwaa","download_url":"https://codeload.github.com/niwaa/react-editables/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243801635,"owners_count":20350107,"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":["content-editable","editable","editor","react"],"created_at":"2024-10-27T05:41:40.506Z","updated_at":"2025-03-16T01:33:03.113Z","avatar_url":"https://github.com/niwaa.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-editables\n\nReact-editables is a react component that makes it easy to edit different types of content (Text, Numbers for now). \nUse-cases are collaborative apps where users may edit the content, in a controlled way.\n\n*NUMBER edition demo:*\n![Alt text](https://i.imgur.com/sYnFago.gif \"Gif showing number edition\")\n\n*TEXT edition demo:*\n![Alt text](https://i.imgur.com/aIoJTpA.gif \"Gif showing number edition\")\n\n## Installation\n\n`npm install react-editables --save`\n\n## Usage\n\nImport the components you want to use in your app:\n```javascript\nimport { EditableText, EditableNumber } from 'react-editables'\n```\n\n### EditableText\n\n```javascript\n\u003cEditableText value='some value here' placeholder='Write a description' /\u003e\n```\n\n### EditableNumber\n\n```javascript\n\u003cEditableNumber value={777} onChange={(value) =\u003e console.log(value)} /\u003e\n```\n\n\n##  Common props\n\n### Optional\n* **value**: initial displayed value.\n* **validate**: a validator function, returning a boolean.\n* **placeholder**: a default text or number when there is not value.\n\n\nValidation function example:  Text length must be more than 30 char.\n\n```javascript\n  doValidation (value) {\n    return (value.length \u003e 30)\n  }\n```\n\n```javascript\n\u003cEditableText validate={this.doValidation} /\u003e\n```\n\n### Hooks\n* **onChange**: a callback function that will be called after user finish editing.\n\n## Contributing\n\nSubmit a PR.\n\n### Tests\n\nTests are written with Jest and Enzyme. Run them with:\n\n``` npm test ```\n\n## To-do\n\n* Expose customization (styles)\n* EditableLink element\n* EditableTags element\n* Add more tests\n* Make it work on mobile iOS\n* More content types :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniwaa%2Freact-editables","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniwaa%2Freact-editables","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniwaa%2Freact-editables/lists"}