Skip to content

Commit

Permalink
Add wasm instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
rockfordlhotka committed Oct 8, 2024
1 parent 4f22410 commit 83a7a7c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,26 @@ The `Marimer.Blazor.RenderMode` library provides a simple way to detect the curr

## Installation

You can install the library via NuGet. Run the following command:
You can install the library via NuGet. Run the following command for a Blazor Server project:

```
dotnet add package Marimer.Blazor.RenderMode
```

For a Blazor WebAssembly project or Razor Class Library, run the following command:

```
dotnet add package Marimer.Blazor.RenderMode.WebAssembly
```

In `Program.cs`, add the following line to register the service:

```csharp
builder.Services.AddRenderModeDetection();
```

When 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.

## Usage

The 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.
Expand Down

0 comments on commit 83a7a7c

Please sign in to comment.