Bit.BlazorUI.AI
11.0.0-pre-19
See the version list below for details.
dotnet add package Bit.BlazorUI.AI --version 11.0.0-pre-19
NuGet\Install-Package Bit.BlazorUI.AI -Version 11.0.0-pre-19
<PackageReference Include="Bit.BlazorUI.AI" Version="11.0.0-pre-19" />
<PackageVersion Include="Bit.BlazorUI.AI" Version="11.0.0-pre-19" />
<PackageReference Include="Bit.BlazorUI.AI" />
paket add Bit.BlazorUI.AI --version 11.0.0-pre-19
#r "nuget: Bit.BlazorUI.AI, 11.0.0-pre-19"
#:package Bit.BlazorUI.AI@11.0.0-pre-19
#addin nuget:?package=Bit.BlazorUI.AI&version=11.0.0-pre-19&prerelease
#tool nuget:?package=Bit.BlazorUI.AI&version=11.0.0-pre-19&prerelease
bit BlazorUI AI: The AI components package of bit BlazorUI
bit BlazorUI AI offers the UI of AI apps for Blazor: conversations, streaming, tool calling, agents, citations, artifacts, structured output and generative UI - as one coherent set of components rather than a pile of them.
Why choose bit BlazorUI AI components?
- Native C# and Blazor throughout: no JavaScript AI library is wrapped, no provider SDK is referenced, and no component knows which model produced what it is drawing.
- Built for streaming: Markdown that is still being written, JSON that is not valid yet, tool calls that have to be shown, approved, run and answered, and transcripts of hundreds of messages that never re-render the world per token.
- Part of bit BlazorUI: built on its components, styled by its theme tokens - dark and light, the Fluent 2, Material and Cupertino presets and right-to-left come for free.
- Universal Support: Compatible with all interactive Blazor modes - Server, WASM, and Hybrid.
Getting Started
To use bit BlazorUI AI components, follow these steps:
- Install the
Bit.BlazorUI.AInuget package.
using command line:
dotnet add package Bit.BlazorUI.AI
or using Package Manager Console:
Install-Package Bit.BlazorUI.AI
- Register its services, together with the transport that talks to your model (in every
Program.csthat renders components):
builder.Services.AddBitBlazorUIAIServices(ai => ai.UseTransport<MyTransport>());
- In the default document (
App.razororindex.html), add theBit.BlazorUI.AICSS file reference after the core one:
<link rel="stylesheet" href="_content/Bit.BlazorUI.AI/styles/bit.blazorui.ai.css" />
- In the default document (
App.razororindex.html), add theBit.BlazorUI.AIJS file reference after the core one:
<script src="_content/Bit.BlazorUI.AI/scripts/bit.blazorui.ai.js"></script>
- In the
_Imports.razor, add the usingBit.BlazorUIto make it available throughout the project.
@using Bit.BlazorUI;
- Start using BlazorUI AI components following its documents: https://blazorui.bitplatform.dev
The one interface you implement
Everything the components do is downstream of a single boundary. Implement it over a provider SDK, an HTTP endpoint, a local model, an orchestrator, or a fixture in a test:
public sealed class MyTransport : IBitAiTransport
{
public async IAsyncEnumerable<BitAiEvent> StreamAsync(
BitAiRequest request,
[EnumeratorCancellation] CancellationToken cancellationToken = default)
{
yield return new BitAiMessageStartedEvent();
await foreach (var token in _model.StreamAsync(request, cancellationToken))
{
yield return new BitAiTextDeltaEvent(token);
}
yield return new BitAiUsageUpdatedEvent(new BitAiTokenUsage { OutputTokens = 128 });
yield return new BitAiMessageCompletedEvent();
}
}
Then a working chat - transcript, composer, streaming Markdown, tool cards, error recovery, keyboard and screen-reader support - is one line:
<BitAiChat />
The packages
The AI packages are split by what each end of an app runs, so an app takes on only the dependencies of what it installs:
| Package | What it holds | Install it in |
|---|---|---|
Bit.BlazorUI.AI |
The components. Brings Bit.BlazorUI.AI.Core. |
The Blazor app |
Bit.BlazorUI.AI.Core |
The transport contract, the events and their wire format, the conversation model, the chat session, the SSE and WebSocket client transports. No UI, no ASP.NET Core. | Comes with the one above; a server or a plain .NET client on its own |
Bit.BlazorUI.AI.Server |
MapBitAiSse, MapBitAiWebSocket, MapBitAiApprovals, BitAiHub, BitAiApprovalBroker. |
The ASP.NET Core server |
Bit.BlazorUI.AI.ChatClient |
The Microsoft.Extensions.AI adapter (StreamBitAiEventsAsync, UseChatClient). |
The server, or a Blazor Server / Hybrid app calling its model directly |
Bit.BlazorUI.AI.SignalR |
The SignalR client transport (UseSignalRTransport). |
The Blazor app, to stream from a BitAiHub |
Streaming from a server with Microsoft.Extensions.AI
With the model behind an IChatClient on your server, you write no transport at all. The packages carry the reply to
the browser in their own wire format, and map the chat client's updates to events for you.
On the server (Bit.BlazorUI.AI.Server and Bit.BlazorUI.AI.ChatClient):
builder.Services.AddChatClient(/* your provider's IChatClient */).UseFunctionInvocation();
app.MapBitAiSse("/api/ai/chat", (request, http, cancellationToken) =>
http.RequestServices.GetRequiredService<IChatClient>()
.StreamBitAiEventsAsync(request, new ChatOptions { ModelId = "my-model" }, cancellationToken))
.RequireAuthorization();
In the browser:
builder.Services.AddBitBlazorUIAIServices(ai =>
ai.UseSseTransport(sp => sp.GetRequiredService<HttpClient>(), new() { Endpoint = "api/ai/chat" }));
- Wire format: each
BitAiEventis one JSON object told apart by itstype("text.delta","tool_call.started", ...), and a request is the transcript as the message snapshots a saved conversation holds.BitAiWireSerializerreads and writes both, through source-generated metadata, so trimmed and native AOT apps work on both ends. The format is versioned (BitAiWireSerializer.Version) and only grows: a reader skips a property it does not know, and reads an event of an unknowntypeasnull, which the transports drop. - Microsoft.Extensions.AI (
Bit.BlazorUI.AI.ChatClient):IChatClient.StreamBitAiEventsAsyncandToBitAiEventsAsyncturn a reply into events (text, reasoning, function calls and results, images, files, citations, usage, errors).ToChatMessagesAsyncandToChatOptionsturn a request into chat messages and options. The server's own options always win over what the browser asks for. A tool registered in the browser is declared to the model, and its call comes back for the chat session to run.UseChatClient()uses anIChatClientright where the components run (Blazor Server, Hybrid). - WebSocket:
MapBitAiWebSocketmaps the same handler on a WebSocket endpoint andUseWebSocketTransportopens a socket per reply to it. A decision on a tool call the server holds goes back up that socket, so it reaches the instance holding the call with no sticky session. An endpoint authenticated by cookie lists the origins it serves (BitAiWebSocketEndpointOptions.WebSockets). - SignalR (
Bit.BlazorUI.AI.SignalRin the browser): derive a hub fromBitAiHub, override itsStreamAsync, and registerUseSignalRTransportwith a connection to it. - Approvals the server holds: every transport implements
IBitAiApprovalTransport. The server streams aBitAiToolApprovalRequestedEventand then awaitsBitAiApprovalBroker.WaitAsync. The user's decision reaches it throughMapBitAiApprovals, the WebSocket or the hub.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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
- Bit.BlazorUI (>= 11.0.0-pre-19)
- Bit.BlazorUI.AI.Core (>= 11.0.0-pre-19)
- Microsoft.AspNetCore.Components.Web (>= 10.0.0)
-
net11.0
- Bit.BlazorUI (>= 11.0.0-pre-19)
- Bit.BlazorUI.AI.Core (>= 11.0.0-pre-19)
- Microsoft.AspNetCore.Components.Web (>= 11.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.0-pre-20 | 0 | 11/15/2026 |
| 11.0.0-pre-19 | 192 | 11/13/2026 |
| 11.0.0-pre-18 | 342 | 11/11/2026 |
| 11.0.0-pre-17 | 733 | 11/4/2026 |
| 11.0.0-pre-16 | 351 | 11/2/2026 |
| 11.0.0-pre-15 | 284 | 10/30/2026 |