Getting Started

Get up and running with NeoUI in your Blazor project in minutes. No Tailwind CSS setup required.

1. Install the Package

Install NeoUI.Blazor from NuGet. It automatically includes the Primitives layer and all three icon libraries.

Terminal
$ dotnet add package NeoUI.Blazor --version 3.6.7

2. Add Namespace Imports

Add the following to your _Imports.razor. These two lines cover every styled component and service for most projects:

RZ_Imports.razor
@using NeoUI.Blazor
@using NeoUI.Blazor.Services

All components and their enums (e.g. ButtonVariant, InputType) live in the single NeoUI.Blazor namespace — no per-component imports needed.

Optional: Lucide Icons (highly recommended)

RZ
@using NeoUI.Icons.Lucide      @* 1,640+ high-quality stroke icons *@

Optional: Primitives (for custom headless styling only)

RZ
@using NeoUI.Blazor.Primitives
@using NeoUI.Blazor.Primitives.Services

Only add these if you are building your own styled components on top of the headless Primitives layer. They are not needed when using NeoUI.Blazor styled components.

3. Register Services

Register the NeoUI services in both your server and WebAssembly Program.cs files:

C#Program.cs
using NeoUI.Blazor.Extensions;
using NeoUI.Blazor.Primitives.Extensions;

// Server project (Program.cs)
builder.Services.AddRazorComponents()
    .AddInteractiveServerComponents()
    .AddInteractiveWebAssemblyComponents();

builder.Services.AddNeoUIPrimitives();
builder.Services.AddNeoUIComponents();

4. Add CSS References

Add the pre-built NeoUI stylesheet to your App.razor. The @Assets[...] directive is the .NET 10 way to reference static web assets — it adds a fingerprint hash to the URL for automatic cache invalidation on each deployment. No Tailwind installation or build process required.

RZApp.razor
<head>
    <!-- Pre-built NeoUI styles — no Tailwind setup required -->
    <link rel="stylesheet" href="@Assets["_content/NeoUI.Blazor/components.css"]" />

    <!-- Pick one base color and one primary color -->
    <link rel="stylesheet" href="@Assets["_content/NeoUI.Blazor/css/themes/base/zinc.css"]" />
    <link rel="stylesheet" href="@Assets["_content/NeoUI.Blazor/css/themes/primary/blue.css"]" />

    <!-- Theme initialization script (prevents flash of unstyled content) -->
    <script src="@Assets["_content/NeoUI.Blazor/js/theme.js"]"></script>
</head>

5. Add Portal Hosts

Overlay and notification components render outside the component tree via a portal system. Add all four hosts at the end of your main layout — after @Body and outside any scrollable or clipping container:

RZMainLayout.razor
@inherits LayoutComponentBase

<div class="min-h-screen bg-background">
    @Body
</div>

@* All four hosts must be outside any scrollable or clipping container *@
<ToastViewport />
<DialogHost />
<ContainerPortalHost />
<OverlayPortalHost />

6. Start Using Components

That's it — you're ready to build:

RZ
<Button>Default</Button>
<Button Variant="ButtonVariant.Outline">Outline</Button>
<Button Variant="ButtonVariant.Secondary">Secondary</Button>
<Badge>New</Badge>

<Dialog>
    <DialogTrigger AsChild>
        <Button Variant="ButtonVariant.Outline">Open Dialog</Button>
    </DialogTrigger>
    <DialogContent>
        <DialogHeader>
            <DialogTitle>Welcome to NeoUI</DialogTitle>
            <DialogDescription>Beautiful Blazor components inspired by shadcn/ui.</DialogDescription>
        </DialogHeader>
        <DialogFooter>
            <DialogClose AsChild>
                <Button Variant="ButtonVariant.Outline">Close</Button>
            </DialogClose>
        </DialogFooter>
    </DialogContent>
</Dialog>
New
Error

Next Steps

Reconnecting...

Attempting to rejoin the server

Connection Lost

Retrying in seconds

Connection Failed

Failed to rejoin the server.
Please retry or reload the page.

Session Paused

The session has been paused by the server

Resume Failed

Failed to resume the session.
Please reload the page.