ReactiveUI.Blazor
25.0.1
Prefix Reserved
dotnet add package ReactiveUI.Blazor --version 25.0.1
NuGet\Install-Package ReactiveUI.Blazor -Version 25.0.1
<PackageReference Include="ReactiveUI.Blazor" Version="25.0.1" />
<PackageVersion Include="ReactiveUI.Blazor" Version="25.0.1" />
<PackageReference Include="ReactiveUI.Blazor" />
paket add ReactiveUI.Blazor --version 25.0.1
#r "nuget: ReactiveUI.Blazor, 25.0.1"
#:package ReactiveUI.Blazor@25.0.1
#addin nuget:?package=ReactiveUI.Blazor&version=25.0.1
#tool nuget:?package=ReactiveUI.Blazor&version=25.0.1
<br> <a href="https://github.com/reactiveui/reactiveui"> <img width="160" heigth="160" src="https://raw.githubusercontent.com/reactiveui/styleguide/master/logo/main.png"> </a> <br>
What is ReactiveUI?
ReactiveUI is a composable, cross-platform model-view-viewmodel framework for all .NET platforms that is inspired by functional reactive programming, which is a paradigm that allows you to abstract mutable state away from your user interfaces and express the idea around a feature in one readable place and improve the testability of your application.
π¨ Get Started π Install Packages π Watch Videos π View Samples π€ Discuss ReactiveUI
Your first view model
A view shows data that changes, so it needs to know when a value changes. Written by hand, each property needs a field and a setter that raises a change notification. Each command needs a property that wraps a method. ReactiveUI writes that code for you while your project builds.
A source generator is a compiler add-on that writes C# code during the build. The ReactiveUI packages bring two
of them.
ReactiveUI.SourceGenerators writes reactive properties
and commands. ReactiveUI.Binding writes the code behind
WhenAnyValue, ToProperty and the view bindings. You install neither yourself.
1. Install the ReactiveUI package for your UI framework. A class library that holds only view models installs
ReactiveUI.
dotnet add package ReactiveUI.WPF
2. Declare the view model as a partial class and mark its members.
using ReactiveUI;
using ReactiveUI.SourceGenerators;
public partial class LoginViewModel : ReactiveObject
{
private readonly IObservable<bool> _canLogIn;
public LoginViewModel()
{
_canLogIn = this.WhenAnyValue(
static x => x.UserName,
static x => x.Password,
static (userName, password) => userName.Length > 0 && password.Length > 0);
_isValidHelper = _canLogIn.ToProperty(this, static x => x.IsValid);
}
[Reactive]
public partial string UserName { get; set; } = string.Empty;
[Reactive]
public partial string Password { get; set; } = string.Empty;
[ObservableAsProperty]
public partial bool IsValid { get; }
[ReactiveCommand(CanExecute = nameof(_canLogIn))]
private async Task<bool> LogInAsync(CancellationToken cancellationToken)
{
await Task.Delay(TimeSpan.FromSeconds(1), cancellationToken);
return Password == "secret";
}
}
WhenAnyValue returns a stream, an IObservable<T> that emits a new value each time either property changes.
3. Build. The generators write the rest of the class:
- The bodies of
UserNameandPassword. Setting either one raises the change notification. - The body of
IsValidand its_isValidHelperfield.ToPropertykeepsIsValidequal to the latest value of_canLogIn. - A
LogInCommandproperty. It holds a command, anICommandthat also reports each result as a stream. The command runsLogInAsync, and it is enabled only while_canLogInemitstrue. The generator drops theAsyncsuffix from the name.
Next, bind the properties and the command to your view with Bind and BindCommand. The
ReactiveUI.Binding documentation shows how. The
source generators documentation lists every attribute
and option.
Partial properties with an initial value need C# 14, the default language version for .NET 10.
How the packages fit together
ReactiveUI is a set of packages. You install the package for your UI framework, and it brings the rest.
| Package | What it gives you |
|---|---|
ReactiveUI |
ReactiveObject, ReactiveCommand, activation, routing and schedulers, built on ReactiveUI.Primitives. It brings ReactiveUI.Core and ReactiveUI.Binding. |
ReactiveUI.Reactive |
The same API built for System.Reactive. It brings ReactiveUI.Core and ReactiveUI.Binding.Reactive. |
ReactiveUI.Core |
The parts both flavours share. It brings ReactiveUI.SourceGenerators. |
ReactiveUI.Binding |
WhenAnyValue, Bind, OneWayBind, BindCommand, ToProperty, [ObservableAsProperty] and view location. |
ReactiveUI.SourceGenerators |
[Reactive], [ReactiveCommand], [ReactiveCollection], [BindableDerivedList] and [IReactiveObject]. |
The ReactiveUI documentation covers the core package, and the installation guide shows which package to install for each platform.
Pick a flavour
ReactiveUI comes in two flavours with the same API. They differ only in the reactive types that appear in that API.
| You want | Install | Reactive types in the API |
|---|---|---|
| No System.Reactive dependency | ReactiveUI, ReactiveUI.WPF, ReactiveUI.WinForms, ReactiveUI.WinUI, ReactiveUI.Maui, ReactiveUI.Blazor, ReactiveUI.AndroidX |
ReactiveUI.Primitives: RxVoid, ISequencer, Signal<T> |
| To mix with code that uses System.Reactive | ReactiveUI.Reactive, ReactiveUI.WPF.Reactive, ReactiveUI.WinForms.Reactive, ReactiveUI.WinUI.Reactive, ReactiveUI.Maui.Reactive, ReactiveUI.Blazor.Reactive, ReactiveUI.AndroidX.Reactive |
System.Reactive: Unit, IScheduler, Subject<T> |
ReactiveUI.Primitives is ReactiveUI's own library of streams, operators and schedulers. Both flavours run on it. The default flavour does not depend on System.Reactive, so your app ships fewer assemblies.
The System.Reactive flavour puts its own types in the ReactiveUI.Reactive namespace. A file that uses
ReactiveObject or ReactiveCommand from it adds using ReactiveUI.Reactive;.
Bindings come from ReactiveUI.Binding
ReactiveUI runs WhenAnyValue, Bind, OneWayBind, BindCommand, ToProperty and view location on
ReactiveUI.Binding. Its source generator writes the code for each
binding while your project builds. Nothing looks up a property by name at run time, so bindings are safe to trim and
to publish with Native AOT.
The ReactiveUI package imports the ReactiveUI.Binding namespace into your project, so binding calls need no using.
Moving from an earlier version? The
migration guide covers
the calls that need an Unsafe twin and the behavior that changed.
Source generators come with ReactiveUI.Core
ReactiveUI.Core references
ReactiveUI.SourceGenerators and passes its generators
on. Every project that installs a ReactiveUI package can use [Reactive], [ReactiveCommand] and the other
attributes. Add using ReactiveUI.SourceGenerators; to each file that uses them. The generators check which flavour
your project references and write code for that flavour.
- Remove your own reference to ReactiveUI.SourceGenerators, or set it to the version ReactiveUI brings or later. An older version fails to restore with error NU1605.
Analyzers
An analyzer checks your code as you type and reports problems as warnings or errors. ReactiveUI.Binding and ReactiveUI.SourceGenerators run their analyzers in your project. They report binding calls and attributes that the generators cannot handle. Diagnostic RXUIBIND021 flags a binding call with no generated binding behind it, such as one that targets a member another source generator adds or a stored lambda; that call throws at run time, so treat the warning as a bug to fix rather than suppress.
The analyzers inside ReactiveUI.Primitives stay out of your project. ReactiveUI references ReactiveUI.Primitives with
ExcludeAssets="analyzers". To use them, reference ReactiveUI.Primitives directly:
<PackageReference Include="ReactiveUI.Primitives" Version="x.y.z" />
Routing
Routing (RoutingState and IScreen) is part of the ReactiveUI package. The WPF, WinUI and MAUI packages add a
RoutedViewHost control that shows the current view, and Windows Forms adds RoutedControlHost. RoutingState reports
navigation as streams. CurrentViewModel emits the view model on top of the stack. NavigationStackChanged emits a
read-only copy of the whole stack after each change. CanNavigateBack emits whether there is a view model to go back
to. The routing migration guide
covers moving from the ReactiveUI.Routing package.
Platform packages
Install the package for your UI framework. Each one brings ReactiveUI. Each one except ReactiveUI.Uno has a
.Reactive twin for the System.Reactive flavour.
| Platform | Package | NuGet |
|---|---|---|
| Class libraries | ReactiveUI | |
| WPF | ReactiveUI.WPF | |
| WinUI | ReactiveUI.WinUI | |
| MAUI | ReactiveUI.Maui | |
| Windows Forms | ReactiveUI.WinForms | |
| Android (AndroidX) | ReactiveUI.AndroidX | |
| Blazor | ReactiveUI.Blazor | |
| Avalonia | ReactiveUI.Avalonia | |
| Uno Platform | ReactiveUI.Uno | |
| Unit tests | ReactiveUI.Testing |
ReactiveUI.Avalonia and ReactiveUI.Uno live in their own repositories.
ReactiveUI.Validation adds validation rules for view models. It lives in its own repository.
Documentation
- RxSchedulers - Using ReactiveUI schedulers without RequiresUnreferencedCode attributes
Book
There has been an excellent book written by our Alumni maintainer Kent Boogart.
Sponsors
JetBrains gives ReactiveUI's maintainers licences for its tools through its open source support programme. Anthropic supports them with Claude through Claude for Open Source. OpenAI supports them with Codex through Codex for Open Source.
See our sponsors for more information. JetBrains, Claude, Anthropic, OpenAI and Codex names and logos are trademarks of their respective owners.
Sponsorship
The core team members, ReactiveUI contributors and contributors in the ecosystem do this open-source work in their free time. If you use ReactiveUI, a serious task, and you'd like us to invest more time on it, please donate. This project increases your income/productivity too. It makes development and applications faster and it reduces the required bandwidth.
Migration from Xamarin and .NET 8 MAUI
Xamarin Users
As of May 2024, Microsoft ended support for Xamarin per their support policy. ReactiveUI has removed support for legacy Xamarin platforms in favor of modern .NET MAUI. For Xamarin projects:
- Xamarin.Forms β Migrate to MAUI and use
ReactiveUI.Maui - Xamarin.Android β Migrate to MAUI Android or use
ReactiveUI.AndroidXfor native Android - Xamarin.iOS/Mac β Migrate to MAUI iOS/Mac Catalyst
For guidance on migrating from Xamarin to MAUI, see the official migration documentation.
MAUI Users
ReactiveUI supports .NET 9 and .NET 10 for MAUI platforms:
net10.0-android/net9.0-androidnet10.0-ios/net9.0-iosnet10.0-maccatalyst/net9.0-maccatalystnet10.0-windows10.0.19041.0/net9.0-windows10.0.19041.0
Non-MAUI net8.0 library targets remain fully supported.
Examples
Platform-specific sample applications are included in src/examples/:
| Sample | Platform | Description |
|---|---|---|
| ReactiveUI.Samples.Wpf | WPF | Login form with reactive bindings, PasswordBox event marshaling |
| ReactiveUI.Samples.Winforms | WinForms | Login form with IViewFor, programmatic UI layout |
| ReactiveUI.Samples.Maui | MAUI | Cross-platform login with Shell navigation, ReactiveContentPage |
| ReactiveUI.Builder.WpfApp | WPF | Multi-instance chat app with routing, suspension, and network sync |
| ReactiveUI.Builder.BlazorServer | Blazor Server | Chat app with server-side Blazor and reactive components |
All samples target .NET 10, use RxAppBuilder for initialization, and demonstrate WhenActivated, Bind/
BindCommand, and proper subscription disposal.
This is how we use the donations:
- Allow the core team to work on ReactiveUI
- Thank contributors if they invested a large amount of time in contributing
- Support projects in the ecosystem
Support
If you have a question, please see if any discussions in our GitHub issues or Stack Overflow have already answered it.
If you want to discuss something or just need help, here is our Slack room, where there are always individuals looking to help out!
Please do not open GitHub issues for support requests.
Contribute
ReactiveUI is developed under an OSI-approved open source license, making it freely usable and distributable, even for commercial use.
If you want to submit pull requests please first open a GitHub issue to discuss. We are first time PR contributors friendly.
See Contribution Guidelines for further information how to contribute changes.
Core Team
<table> <tbody> <tr> <td align="center" valign="top" width="105"> <img width="100" height="100" src="https://github.com/glennawatson.png?s=150"> <br> <a href="https://github.com/glennawatson">Glenn Watson</a> <p>Melbourne, Australia</p> </td> <td align="center" valign="top" width="105"> <img width="100" height="100" src="https://github.com/chrispulman.png?s=150"> <br> <a href="https://github.com/chrispulman">Chris Pulman</a> <p>United Kingdom</p> </td> </tr> </tbody> </table>
Alumni Core Team
The following have been core team members in the past.
<table> <tbody> <tr> <td align="center" valign="top" width="105"> <img width="100" height="100" src="https://github.com/ghuntley.png?s=150"> <br> <a href="https://github.com/ghuntley">Geoffrey Huntley</a> <p>Sydney, Australia</p> </td> <td align="center" valign="top" width="105"> <img width="100" height="100" src="https://github.com/kentcb.png?s=150"> <br> <a href="https://github.com/kentcb">Kent Boogaart</a> <p>Brisbane, Australia</p> </td> <td align="center" valign="top" width="105"> <img width="100" height="100" src="https://github.com/olevett.png?s=150"> <br> <a href="https://github.com/olevett">Olly Levett</a> <p>London, United Kingdom</p> </td> </tr> <tr> <td align="center" valign="top" width="105"> <img width="100" height="100" src="https://github.com/anaisbetts.png?s=150"> <br> <a href="https://github.com/anaisbetts">AnaΓ―s Betts</a> <p>San Francisco, USA</p> </td> <td align="center" valign="top" width="105"> <img width="100" height="100" src="https://github.com/shiftkey.png?s=150"> <br> <a href="https://github.com/shiftkey">Brendan Forster</a> <p>Melbourne, Australia</p> </td> <td align="center" valign="top" width="105"> <img width="100" height="100" src="https://github.com/clairernovotny.png?s=150"> <br> <a href="https://github.com/clairernovotny">Claire Novotny</a> <p>New York, USA</p> </td> </tr> <tr> <td align="center" valign="top" width="105"> <img width="100" height="100" src="https://github.com/worldbeater.png?s=150"> <br> <a href="https://github.com/worldbeater">Artyom Gorchakov</a> <p>Moscow, Russia</p> </td> <td align="center" valign="top" width="105"> <img width="100" height="100" src="https://github.com/rlittlesii.png?s=150"> <br> <a href="https://github.com/rlittlesii">Rodney Littles II</a> <p>Texas, USA</p> </td> <td align="center" valign="top" width="105"> <img width="100" height="100" src="https://github.com/cabauman.png?s=150"> <br> <a href="https://github.com/cabauman">Colt Bauman</a> <p>South Korea</p> </td> </tr> </tbody> </table>
.NET Foundation
ReactiveUI is part of the .NET Foundation. Other projects that are associated with the foundation include the Microsoft .NET Compiler Platform ("Roslyn") as well as the Microsoft ASP.NET family of projects, and Microsoft .NET Core.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net11.0 is compatible. |
-
net10.0
- Microsoft.AspNetCore.Components (>= 10.0.12)
- ReactiveUI (>= 25.0.1)
- ReactiveUI.Binding (>= 8.6.0)
- ReactiveUI.Disposables (>= 8.2.0)
- ReactiveUI.Primitives (>= 8.2.0)
- ReactiveUI.Primitives.Blazor (>= 8.2.0)
- ReactiveUI.Primitives.Core (>= 8.2.0)
- ReactiveUI.SourceGenerators (>= 4.2.0)
- Splat (>= 21.0.0)
-
net11.0
- Microsoft.AspNetCore.Components (>= 11.0.0-rc.1.26425.128)
- ReactiveUI (>= 25.0.1)
- ReactiveUI.Binding (>= 8.6.0)
- ReactiveUI.Disposables (>= 8.2.0)
- ReactiveUI.Primitives (>= 8.2.0)
- ReactiveUI.Primitives.Blazor (>= 8.2.0)
- ReactiveUI.Primitives.Core (>= 8.2.0)
- ReactiveUI.SourceGenerators (>= 4.2.0)
- Splat (>= 21.0.0)
-
net8.0
- Microsoft.AspNetCore.Components (>= 8.0.31)
- ReactiveUI (>= 25.0.1)
- ReactiveUI.Binding (>= 8.6.0)
- ReactiveUI.Disposables (>= 8.2.0)
- ReactiveUI.Primitives (>= 8.2.0)
- ReactiveUI.Primitives.Blazor (>= 8.2.0)
- ReactiveUI.Primitives.Core (>= 8.2.0)
- ReactiveUI.SourceGenerators (>= 4.2.0)
- Splat (>= 21.0.0)
-
net9.0
- Microsoft.AspNetCore.Components (>= 9.0.20)
- ReactiveUI (>= 25.0.1)
- ReactiveUI.Binding (>= 8.6.0)
- ReactiveUI.Disposables (>= 8.2.0)
- ReactiveUI.Primitives (>= 8.2.0)
- ReactiveUI.Primitives.Blazor (>= 8.2.0)
- ReactiveUI.Primitives.Core (>= 8.2.0)
- ReactiveUI.SourceGenerators (>= 4.2.0)
- Splat (>= 21.0.0)
NuGet packages (9)
Showing the top 5 NuGet packages that depend on ReactiveUI.Blazor:
| Package | Downloads |
|---|---|
|
Whipstaff.Blazor
Re-usable logic for working with Blazor. |
|
|
Maincotech.Cms.Blazor
Cms Blazor UI based on AntDesign |
|
|
CretNet.Platform.Blazor
CretNet is a collection of powerful, open-source packages designed to enhance and streamline your .NET development experience. |
|
|
RZ.Foundation.Blazor
Package Description |
|
|
Basyc.MessageBus.Manager.Presentation.BlazorLibrary
Package Description |
GitHub repositories (5)
Showing the top 5 popular GitHub repositories that depend on ReactiveUI.Blazor:
| Repository | Stars |
|---|---|
|
reactiveui/ReactiveUI.Samples
This repository contains ReactiveUI samples.
|
|
|
MyNihongo/MudBlazor.Markdown
Markdown component based on the MudBlazor environment
|
|
|
reactiveui/ReactiveMvvm
A sample application showing one set of ReactiveUI view models shared across many .NET UI frameworks. Includes front ends for Avalonia, .NET MAUI, WPF, Windows Forms, Blazor and Terminal.Gui.
|
|
|
moonheart/mementomori-helper
γ‘γ‘γ³γγ’γͺ MementoMori ζΈΈζε©ζ Game Assistant γ²γΌγ γ’γ·γΉγΏγ³γ
|
|
|
Nethereum/Nethereum-Explorer-Wallet-Template-Blazor
Nethereum Light Blockchain Explorer Explorer, Wallet using Blazor, ReactiveUI
|
| Version | Downloads | Last Updated |
|---|---|---|
| 25.0.1 | 0 | 9/27/2026 |
| 25.0.0 | 0 | 9/27/2026 |
| 24.3.0 | 172 | 9/24/2026 |
| 24.2.0 | 3,009 | 9/4/2026 |
| 24.1.0 | 7,041 | 8/2/2026 |
| 24.0.0 | 789 | 7/26/2026 |
| 24.0.0-beta.3 | 74 | 7/3/2026 |
| 24.0.0-beta.2 | 77 | 6/29/2026 |
| 24.0.0-beta.1 | 113 | 6/26/2026 |
| 23.2.28 | 15,942 | 6/3/2026 |
| 23.1.0-beta.8 | 109 | 2/6/2026 |
| 23.1.0-beta.1 | 103 | 1/21/2026 |
| 22.3.1 | 33,620 | 11/30/2025 |
| 22.2.1 | 5,779 | 10/24/2025 |
| 22.1.1 | 10,013 | 10/11/2025 |