{"id":15649125,"url":"https://github.com/samprof/reactsharp","last_synced_at":"2025-04-30T15:23:04.779Z","repository":{"id":40887129,"uuid":"238811892","full_name":"SamProf/ReactSharp","owner":"SamProf","description":"C# library for building web user interfaces","archived":false,"fork":false,"pushed_at":"2023-10-20T20:37:32.000Z","size":357,"stargazers_count":40,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-29T19:43:00.575Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://reactsharp.samprof.com/","language":"C#","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/SamProf.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}},"created_at":"2020-02-07T00:17:20.000Z","updated_at":"2023-03-13T16:06:03.000Z","dependencies_parsed_at":"2023-01-25T06:00:55.761Z","dependency_job_id":"9820f48c-0bda-495f-ba0b-668c3b47940a","html_url":"https://github.com/SamProf/ReactSharp","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/SamProf%2FReactSharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamProf%2FReactSharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamProf%2FReactSharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamProf%2FReactSharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SamProf","download_url":"https://codeload.github.com/SamProf/ReactSharp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242667466,"owners_count":20166296,"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-10-03T12:28:07.417Z","updated_at":"2025-03-09T08:30:58.784Z","avatar_url":"https://github.com/SamProf.png","language":"C#","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=9XT68N2VKWTPE\u0026source=url","https://www.patreon.com/SamProf"],"categories":[],"sub_categories":[],"readme":"# React#\n\n## ReactSharp - A C# library for building web user interfaces\n## React alternative to Blazor\n## Super Experimental - super unstable\n\n[![NuGet](https://img.shields.io/nuget/v/ReactSharp.svg)](https://www.nuget.org/packages/ReactSharp.Blazor/)\n[![Gitter](https://badges.gitter.im/ReactSharp/community.svg)](https://gitter.im/MatBlazor/community?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge)\n[![GitHub Stars](https://img.shields.io/github/stars/SamProf/ReactSharp.svg)](https://github.com/SamProf/ReactSharp/stargazers)\n[![GitHub Issues](https://img.shields.io/github/issues/SamProf/ReactSharp.svg)](https://github.com/SamProf/ReactSharp/issues)\n[![Live Demo](https://img.shields.io/badge/demo-online-green.svg)](https://reactsharp.samprof.com)\n[![MIT](https://img.shields.io/github/license/SamProf/ReactSharp.svg)](LICENSE)\n[![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=9XT68N2VKWTPE\u0026source=url)\n[![Patreon](https://img.shields.io/badge/Patreon-donation-blue)](https://www.patreon.com/SamProf)\n\n\n## Demo and Documentation\n- [ReactSharp](http://reactsharp.samprof.com)\n- [ReactSharp Todo](http://reactsharp.samprof.com/Todo)\n\n\n## Examples\n\n### Counter.cs\n```csharp\n public class Counter : ReactComponent\n    {\n        private int value = 0;\n\n        void Increment()\n        {\n            SetState(() =\u003e { value++; });\n        }\n\n        void Decrement()\n        {\n            SetState(() =\u003e { value--; });\n        }\n\n\n        public override object Render()\n        {\n            return new ReactElement($@\"\n\u003cdiv\u003e\n    \u003ch4\u003eCounter value: {value}\u003c/h4\u003e\n    \u003cp\u003e\n        \u003cbutton type='button' class='btn btn-primary' onclick='{new Action(Increment)}'\u003eIncrement\u003c/button\u003e\n        \u003cbutton type='button' class='btn btn-primary' onclick='{new Action((Decrement))}'\u003eDecrement\u003c/button\u003e\n    \u003c/p\u003e\n\u003c/div\u003e\n\");\n        }\n    }\n```\n\n### App.cs\n```csharp\n public class App : ReactComponent\n    {\n        public override object Render()\n        {\n            return new ReactElement($@\"\n\u003cFragment\u003e\n\n    \u003cp style='padding-top: 20px;'\u003e \n        \u003cCounter /\u003e\n    \u003c/p\u003e\n\n\u003c/Fragment\u003e\n\");\n        }\n    }\n```\n\n\n### Index.razor\n\n```html\n\u003cReactSharpBlazor Prerender=\"true\" Element=\"@_reactElement\"\u003e\u003c/ReactSharpBlazor\u003e\n\n@code\n{\n    ReactElement _reactElement = new ReactElement($@\"\u003cApp/\u003e\");\n}\n```\n\n\n### Todo.cs [In action](http://reactsharp.samprof.com/Todo)\n```csharp\n    public class Todo : ReactComponent\n    {\n        List\u003cstring\u003e items = Enumerable.Range(0, 10).Select(i =\u003e i.ToString()).ToList();\n        \n\n        void Add()\n        {\n            SetState(() =\u003e { this.items.Add(Guid.NewGuid().ToString()); });\n        }\n\n\n        void Remove(string item)\n        {\n            SetState(() =\u003e { this.items.Remove(item); });\n        }\n\n\n        public override object Render()\n        {\n            return new ReactElement($@\"\n\u003cdiv\u003e\n    \u003ch4\u003eTodo: {items.Count}\u003c/h4\u003e\n    \u003cp\u003e\n        \u003cbutton type='button' class='btn btn-primary' onclick='{new Action((Add))}'\u003eAdd item\u003c/button\u003e\n    \u003c/p\u003e\n    {items.Select(i =\u003e new ReactElement($\"\u003cdiv\u003eTask - {i} \u003cbutton onclick='{new Action(() =\u003e Remove(i))}'\u003eX\u003c/button\u003e\u003c/div\u003e\"))}\n   \n\u003c/div\u003e\n\");\n        }\n    }\n```\n\n\n\n\n\n## News\n\n### ReactSharp 1.0.0\n- First public release\n\n\n## Prerequisites\n\nDon't know what Blazor is? Read [here](https://github.com/aspnet/Blazor)\n\nComplete all Blazor dependencies.\n\n- .NET Core 3.1\n- Visual Studio 2019 with the ASP.NET and web development workload selected.\n\n## Installation \n\nLatest version in here:  [![NuGet](https://img.shields.io/nuget/v/ReactSharp.Blazor.svg)](https://www.nuget.org/packages/ReactSharp.Blazor/)\n\n\nTo Install \n\n```\nInstall-Package ReactSharp\nInstall-Package ReactSharp.Blazor\n```\n\nFor client-side and server-side Blazor - add script section to index.html or _Host.cshtml (head section) \n\n```html\n\u003cscript src=\"_content/ReactSharp.Blazor/react-sharp.js\"\u003e\u003c/script\u003e\n```\n\n\n## Questions\n\nFor *how-to* questions and other non-issues, for now you can use issues or you can use [![Gitter](https://badges.gitter.im/MatBlazor/community.svg)](https://gitter.im/MatBlazor/community?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge).\n\n\n## Contributing\nWe'd greatly appreciate any contribution you make. :)\n\n## Sponsors \u0026 Backers\nReactSharp does not run under the umbrella of any company or anything like that.\nIt is an independent project created in spare time.\n\nIf you think that this project helped you or your company in any way, you can consider becoming a backer/sponsor.\n- [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=9XT68N2VKWTPE\u0026source=url)\n- [Patreon](https://www.patreon.com/SamProf)\n\n\n\n## License\n\nThis project is licensed under the terms of the [MIT license](LICENSE).\n\n## Thank you\n- [Blazor](https://blazor.net)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamprof%2Freactsharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamprof%2Freactsharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamprof%2Freactsharp/lists"}