{"id":17093522,"url":"https://github.com/oliverloops/react-hider","last_synced_at":"2025-09-06T03:42:48.237Z","repository":{"id":42808096,"uuid":"269996183","full_name":"oliverloops/react-hider","owner":"oliverloops","description":"🎩  A minimalist show or not library based on conditional rendering foundations","archived":false,"fork":false,"pushed_at":"2022-03-26T20:46:37.000Z","size":168,"stargazers_count":31,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T22:44:42.436Z","etag":null,"topics":["conditional-rendering","jsx","react"],"latest_commit_sha":null,"homepage":"","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/oliverloops.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-06-06T13:53:38.000Z","updated_at":"2023-03-08T15:41:06.000Z","dependencies_parsed_at":"2022-09-01T14:24:11.479Z","dependency_job_id":null,"html_url":"https://github.com/oliverloops/react-hider","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/oliverloops/react-hider","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverloops%2Freact-hider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverloops%2Freact-hider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverloops%2Freact-hider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverloops%2Freact-hider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oliverloops","download_url":"https://codeload.github.com/oliverloops/react-hider/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oliverloops%2Freact-hider/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273854444,"owners_count":25180008,"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","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["conditional-rendering","jsx","react"],"created_at":"2024-10-14T14:07:25.388Z","updated_at":"2025-09-06T03:42:48.207Z","avatar_url":"https://github.com/oliverloops.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![react-hider](logo/react-hider-logo.jpg)\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\u003cstrong\u003eConditional Rendering Made Easy\u003c/strong\u003e\u003c/div\u003e\n\u003cdiv align=\"center\"\u003eA minimalist show or not library based on conditional rendering foundations\u003c/div\u003e\n\n\u003cbr /\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003c!-- Badges --\u003e\n\n![Release](https://img.shields.io/badge/release-v1.0.3-success)\u0026nbsp;![Dependencies](https://img.shields.io/badge/dependencies-up%20to%20date-success)\u0026nbsp;![Version](https://img.shields.io/github/v/release/facebook/react?logo=react)\u0026nbsp;![License](https://img.shields.io/npm/l/react?color=blue)\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003csub\u003eCreated by \u003ca href=\"https://twitter.com/theoliveralr\"\u003eOliver ALR\u003c/a\u003e and mantained with ❤️ and ☕️. Join me just contributing 💻\u003c/sub\u003e\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n## Features\n\n\u003cdl\u003e\n    \u003cdt\u003e\u003ci\u003eJust one component\u003c/i\u003e\u003c/dt\u003e\n    \u003cdd\u003eWrap all your to-render components inside Hider component.\u003c/dd\u003e\n\u003c/dl\u003e\n\u003cdl\u003e\n    \u003cdt\u003e\u003ci\u003eLess verbose components\u003c/i\u003e\u003c/dt\u003e\n    \u003cdd\u003eSimple as reduce dirty components doing more readable code.\u003c/dd\u003e\n\u003c/dl\u003e\n\u003cdl\u003e\n    \u003cdt\u003e\u003ci\u003eInline if with \u0026\u0026 logical operator\u003c/i\u003e\u003c/dt\u003e\n    \u003cdd\u003eRender one single component if the condition is true.\u003cdd\u003e\n\u003c/dl\u003e\n\u003cdl\u003e\n    \u003cdt\u003e\u003ci\u003eInline if-else with conditional operator\u003c/i\u003e\u003c/dt\u003e\n    \u003cdd\u003eRender or not an expected value based on a boolean prop.\u003c/dd\u003e\n\u003c/dl\u003e\n\u003cdl\u003e\n     \u003cdd\u003eWorking on version 1.1 😬\u003c/dd\u003e\n\u003c/dl\u003e\n\n### Get Started\n\n```\nnpm install react-hider\n```\n\n```\nimport Hider from 'react-hider'\n```\n\nWrap first the component to show and second the component to hide\ninside Hider component or use pure raw jsx and provide an initial \u003cstrong\u003eboolean(true/false)\u003c/strong\u003e state:\n\n```jsx\n\u003cHider state={boolean}\u003e\n    \u003cComponentToShow /\u003e\n    \u003cComponentToHide /\u003e\n\u003c/Hider\u003e\n```\n\n## Examples Up and Running\n\nShow or Hide elements based on a \u003cstrong\u003eboolean(true/false)\u003c/strong\u003e pased to state prop:\n\n```jsx\nconst DisAppear = () =\u003e {\n    const [hide, setHide] = useState(true)\n\n    return (\n        \u003cdiv\u003e\n            \u003cHider state={hide}\u003e\n                \u003cShow /\u003e\n                \u003cHide /\u003e\n            \u003c/Hider\u003e\n            \u003cbutton onClick={() =\u003e setHide(false)}\u003eClick to Change\u003c/button\u003e\n        \u003c/div\u003e\n    )\n}\n```\n\nShow just one single element just if the \u003cstrong\u003eboolean state is true\u003c/strong\u003e:\n\n```jsx\nconst Appear = () =\u003e {\n    const [show, setShow] = useState(false)\n\n    return (\n        \u003cdiv\u003e\n            \u003cHider state={show}\u003e\n                \u003cShow /\u003e\n            \u003c/Hider\u003e\n            \u003cbutton onClick={() =\u003e setShow(true)}\u003eClick to Show\u003c/button\u003e\n        \u003c/div\u003e\n    )\n}\n```\n\nYou can use one or both \u003cstrong\u003eunwrapped\u003c/strong\u003e elements too:\n\n```jsx\nconst DisAppear = () =\u003e {\n    const [hide, setHide] = useState(true)\n\n    return (\n        \u003cdiv\u003e\n            \u003cHider state={hide}\u003e\n                \u003cShow /\u003e\n                \u003cspan\u003e\n                    \u003ch2\u003eI want to hide this content\u003c/h2\u003e\n                    \u003csmall\u003eThis content is initially hided\u003c/small\u003e\n                \u003c/span\u003e\n            \u003c/Hider\u003e\n            \u003cbutton onClick={() =\u003e setHide(false)}\u003eClick to Change\u003c/button\u003e\n        \u003c/div\u003e\n    )\n}\n```\n\nJust wrap inside Hider all the elements required even if this ones aren't inside a component.\n\n## License\n\nThis project is licensed under the MIT license, Copyright © 2020 Oliver ALR.\nFor more information see `LICENSE.md`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverloops%2Freact-hider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foliverloops%2Freact-hider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foliverloops%2Freact-hider/lists"}