{"id":13674840,"url":"https://github.com/kitze/react-disable","last_synced_at":"2025-04-13T13:08:02.772Z","repository":{"id":36332491,"uuid":"222693923","full_name":"kitze/react-disable","owner":"kitze","description":"A React component for disabling a section of an app","archived":false,"fork":false,"pushed_at":"2023-01-05T01:12:42.000Z","size":532,"stargazers_count":78,"open_issues_count":18,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-13T13:07:57.982Z","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/kitze.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-11-19T12:43:46.000Z","updated_at":"2024-02-23T19:34:45.000Z","dependencies_parsed_at":"2023-01-17T01:32:31.687Z","dependency_job_id":null,"html_url":"https://github.com/kitze/react-disable","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/kitze%2Freact-disable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitze%2Freact-disable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitze%2Freact-disable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kitze%2Freact-disable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kitze","download_url":"https://codeload.github.com/kitze/react-disable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248717242,"owners_count":21150389,"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-08-02T11:01:04.200Z","updated_at":"2025-04-13T13:08:02.741Z","avatar_url":"https://github.com/kitze.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# 🙅‍♂️ react-disable\n\n### Other projects by [@thekitze](https://twitter.com/thekitze)\n\n- 💻 [Sizzy](https://sizzy.co) - A browser for developers and designers\n- 🏫 [React Academy](https://reactacademy.io) - Interactive React and GraphQL workshops\n- 💌 [Twizzy](https://twizzy.app) - A standalone app for Twitter DM\n- 🤖 [JSUI](https://github.com/kitze/JSUI) - A powerful UI toolkit for managing JavaScript apps\n\n---\n\n## Demo\n![demo](https://i.imgur.com/9D6Xeps.gif)\n\n## Usage\n\n`yarn add react-disable`\n\nJust wrap any children with the `Disable` component in order to disable the section.\nThe disabled sections are also aware if a parent is disabled, so they will be disabled, but the styles won't be duplicated (the opacity won't be multiplied, etc.)\n\n```jsx\nimport { Disable } from 'react-disable';\n\nconst App = () =\u003e {\n  const [disableForm, setDisableForm] = React.useState(false);\n  const toggle = () =\u003e setDisableForm(d =\u003e !d);\n\n  return (\n    \u003cdiv\u003e\n      \u003ch1\u003eHello world\u003c/h1\u003e\n      \u003cbutton onClick={toggle}\u003etoggle disable form\u003c/button\u003e\n\n      \u003cDisable disabled={disableForm}\u003e\n        \u003ch3\u003eLogin form \u003c/h3\u003e\n        \u003cinput placeholder=\"username\" type=\"text\" /\u003e\n        \u003cinput placeholder=\"password\" type=\"text\" /\u003e\n        \u003cbutton\u003esubmit\u003c/button\u003e\n      \u003c/Disable\u003e\n\n    \u003c/div\u003e\n  );\n};\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitze%2Freact-disable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkitze%2Freact-disable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkitze%2Freact-disable/lists"}