{"id":28281296,"url":"https://github.com/twocatmoon/react-template-helpers","last_synced_at":"2026-04-26T20:32:22.566Z","repository":{"id":57168406,"uuid":"468858564","full_name":"twocatmoon/react-template-helpers","owner":"twocatmoon","description":"Branching and iterative logic helpers for React, to help make your templates cleaner.","archived":false,"fork":false,"pushed_at":"2022-07-19T20:11:08.000Z","size":752,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"trunk","last_synced_at":"2025-10-24T08:56:09.356Z","etag":null,"topics":["branching","control-flow","enumerable","for","if","iterative","react"],"latest_commit_sha":null,"homepage":"https://github.com/twocatmoon/react-template-helpers","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/twocatmoon.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":"2022-03-11T18:25:07.000Z","updated_at":"2025-08-25T17:04:09.000Z","dependencies_parsed_at":"2022-09-08T17:52:12.048Z","dependency_job_id":null,"html_url":"https://github.com/twocatmoon/react-template-helpers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/twocatmoon/react-template-helpers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twocatmoon%2Freact-template-helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twocatmoon%2Freact-template-helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twocatmoon%2Freact-template-helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twocatmoon%2Freact-template-helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/twocatmoon","download_url":"https://codeload.github.com/twocatmoon/react-template-helpers/tar.gz/refs/heads/trunk","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/twocatmoon%2Freact-template-helpers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32312296,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T19:15:34.056Z","status":"ssl_error","status_checked_at":"2026-04-26T19:15:15.467Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["branching","control-flow","enumerable","for","if","iterative","react"],"created_at":"2025-05-21T11:16:27.870Z","updated_at":"2026-04-26T20:32:22.544Z","avatar_url":"https://github.com/twocatmoon.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv id=\"top\"\u003e\u003c/div\u003e\n\n[![Contributors][contributors-shield]][contributors-url]\n[![Forks][forks-shield]][forks-url]\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![MIT License][license-shield]][license-url]\n\n\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ch3 align=\"center\"\u003eReact Template Helpers\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    Branching and iterative logic helpers for React, to help make your templates cleaner.\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/twocatmoon/react-template-helpers\"\u003e\u003cstrong\u003eExplore the docs »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/twocatmoon/react-template-helpers/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/twocatmoon/react-template-helpers/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003col\u003e\n    \u003cli\u003e\n      \u003ca href=\"#about-the-project\"\u003eAbout The Project\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#conditional-rendering\"\u003eConditional Rendering\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#collection-rendering\"\u003eCollection Rendering\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#built-with\"\u003eBuilt With\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contact\"\u003eContact\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#acknowledgments\"\u003eAcknowledgments\u003c/a\u003e\u003c/li\u003e\n  \u003c/ol\u003e\n\u003c/details\u003e\n\n\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n## About The Project\n\nReact Template Helpers implements a control flow API inspired by Vue.js. \n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n### Conditional Rendering\n\nUse the `If` function to conditionally render a block. The block will only be rendered if the condition returns a truthy value.\n\n```tsx\n{ \n  If(condition, () =\u003e (\u003ch1\u003eHello, world!\u003c/h1\u003e)).EndIf()\n}\n```\n\nIt is also possible to add an “else block” with `ElseIf` and `Else`:\n\n```tsx\n{ \n  If(condition, () =\u003e (\u003ch1\u003eHello, world!\u003c/h1\u003e))\n  .ElseIf(otherCondition, () =\u003e (\u003ch1\u003eHello, again!\u003c/h1\u003e))\n  .Else(() =\u003e (\u003ch1\u003eGoodbye.\u003c/h1\u003e))\n  .EndIf() \n}\n```\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n### Collection Rendering\n\nUse the `For` function to render a collection of items, like an array:\n\n```tsx\n{\n  For([1, 2, 3], (item, i) =\u003e (\n    \u003cp key={i}\u003e{item}\u003c/p\u003e\n  ))\n}\n```\n\nWhen using `For` with an array, you can get additional context about the current item's place in the array:\n\n```tsx\n{\n  For([1, 2, 3], (item, i, { isFirst, isLast, isEven, isNth }) =\u003e (\n    \u003cp key={i} className={isEven ? '--even' : '--odd'}\u003e{item}\u003c/p\u003e\n  ))\n}\n```\n\nYou can also use `For` with objects, although the output order is not guaranteed, and additional context about the item is not available:\n\n```tsx\n{\n  For({ a: 1, b: 2, c: 3 }, (item, key) =\u003e (\n    \u003cp key={key}\u003e{item}\u003c/p\u003e\n  ))\n}\n```\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n### Built With\n\n* [React.js](https://reactjs.org/)\n* [TypeScript](https://www.typescriptlang.org/)\n* [Vite](https://vitejs.dev/)\n* [TypeDoc](https://typedoc.org/)\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\u003c!-- INSTALLATION --\u003e\n## Installation\n\n1. Install from NPM\n   ```sh\n   npm i @twocatmoon/react-template-helpers\n   ```\n2. Include in your project\n   ```ts\n   import { If, For } from '@twocatmoon/react-template-helpers'\n   ```\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- USAGE EXAMPLES --\u003e\n## Usage\n\n_Please refer to the [Documentation](https://twocatmoon.github.io/react-template-helpers)_\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- CONTRIBUTING --\u003e\n## Contributing\n\nContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\nIf you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag \"enhancement\".\nDon't forget to give the project a star! Thanks again!\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- LICENSE --\u003e\n## License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- CONTACT --\u003e\n## Contact\n\nTwitter - [@twocatmoon](https://twitter.com/twocatmoon)\n\nProject Link - [https://github.com/twocatmoon/react-template-helpers](https://github.com/twocatmoon/react-template-helpers)\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- ACKNOWLEDGMENTS --\u003e\n## Acknowledgments\n\n* [Best-README-Template](https://github.com/othneildrew/Best-README-Template)\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n\u003c!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --\u003e\n[contributors-shield]: https://img.shields.io/github/contributors/twocatmoon/react-template-helpers.svg?style=for-the-badge\n[contributors-url]: https://github.com/twocatmoon/react-template-helpers/graphs/contributors\n[forks-shield]: https://img.shields.io/github/forks/twocatmoon/react-template-helpers.svg?style=for-the-badge\n[forks-url]: https://github.com/twocatmoon/react-template-helpers/network/members\n[stars-shield]: https://img.shields.io/github/stars/twocatmoon/react-template-helpers.svg?style=for-the-badge\n[stars-url]: https://github.com/twocatmoon/react-template-helpers/stargazers\n[issues-shield]: https://img.shields.io/github/issues/twocatmoon/react-template-helpers.svg?style=for-the-badge\n[issues-url]: https://github.com/twocatmoon/react-template-helpers/issues\n[license-shield]: https://img.shields.io/github/license/twocatmoon/react-template-helpers.svg?style=for-the-badge\n[license-url]: https://github.com/twocatmoon/react-template-helpers/blob/master/LICENSE.txt\n[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge\u0026logo=linkedin\u0026colorB=555\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwocatmoon%2Freact-template-helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftwocatmoon%2Freact-template-helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftwocatmoon%2Freact-template-helpers/lists"}