{"id":20748924,"url":"https://github.com/marimerllc/marimer.blazor.rendermode","last_synced_at":"2025-04-28T12:04:44.350Z","repository":{"id":256291514,"uuid":"854854230","full_name":"MarimerLLC/Marimer.Blazor.RenderMode","owner":"MarimerLLC","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-08T20:22:48.000Z","size":13,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-28T12:04:38.701Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/MarimerLLC.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":"2024-09-09T22:13:07.000Z","updated_at":"2024-10-10T12:34:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"f0dc072c-4592-40b6-97d8-239a4456e99d","html_url":"https://github.com/MarimerLLC/Marimer.Blazor.RenderMode","commit_stats":null,"previous_names":["marimerllc/marimer.blazor.rendermode"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarimerLLC%2FMarimer.Blazor.RenderMode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarimerLLC%2FMarimer.Blazor.RenderMode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarimerLLC%2FMarimer.Blazor.RenderMode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarimerLLC%2FMarimer.Blazor.RenderMode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarimerLLC","download_url":"https://codeload.github.com/MarimerLLC/Marimer.Blazor.RenderMode/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251311330,"owners_count":21569009,"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-11-17T08:19:30.758Z","updated_at":"2025-04-28T12:04:44.338Z","avatar_url":"https://github.com/MarimerLLC.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Blazor Render Mode Detection\n\nThe `Marimer.Blazor.RenderMode` library provides a simple way to detect the current render mode of a Blazor application.\n\n## Installation\n\nYou can install the library via NuGet. Run the following command for a Blazor Server project:\n\n```\ndotnet add package Marimer.Blazor.RenderMode\n```\n\nFor a Blazor WebAssembly project or Razor Class Library, run the following command:\n\n```\ndotnet add package Marimer.Blazor.RenderMode.WebAssembly\n```\n\nIn `Program.cs`, add the following line to register the service:\n\n```csharp\nbuilder.Services.AddRenderModeDetection();\n```\n\nWhen using a Razor Class Library that may be loaded in WebAssembly, make sure to add that registration to the client-side `Program.cs` as well.\n\n## Usage\n\nThe library provides a `RenderModeProvider` service that you can inject into your components. The service has a single method `GetRenderMode` that returns the current render mode for the current page or component.\n\n```csharp\n@inject RenderModeProvider RenderMode\n@using Marimer.Blazor.RenderMode\n\nvar mode = RenderMode.GetRenderMode(this);\n\n@if (mode.IsInteractive() \u0026\u0026 mode.IsServer())\n{\n    \u003cp\u003eThis is a server interactive Blazor page\u003c/p\u003e\n}\nelse if (mode.IsWebAssembly())\n{\n    \u003cp\u003eThis is a WebAssembly interactive Blazor page\u003c/p\u003e\n}\nelse if (mode.IsServer() \u0026\u0026 mode.IsStreaming())\n{\n    \u003cp\u003eThis is a streaming server static Blazor page\u003c/p\u003e\n}\nelse\n{\n    \u003cp\u003eThis is a server static Blazor page\u003c/p\u003e\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarimerllc%2Fmarimer.blazor.rendermode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarimerllc%2Fmarimer.blazor.rendermode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarimerllc%2Fmarimer.blazor.rendermode/lists"}